Пример #1
0
func (win *Window) GetData(name string) interface{} {
	cname := C.CString(name)
	defer C.free(unsafe.Pointer(cname))

	data := C.SDL_GetWindowData(win.c, cname)
	if data == nil {
		return nil
	}

	return *(*interface{})(data)
}
Пример #2
0
func (window *Window) GetData(name string) unsafe.Pointer {
	_window := (*C.SDL_Window)(unsafe.Pointer(window))
	_name := C.CString(name)
	defer C.free(unsafe.Pointer(_name))
	return (unsafe.Pointer)(C.SDL_GetWindowData(_window, _name))
}
Пример #3
0
// Window (https://wiki.libsdl.org/SDL_GetWindowData)
func (window *Window) GetData(name string) unsafe.Pointer {
	_name := C.CString(name)
	return unsafe.Pointer(C.SDL_GetWindowData(window.cptr(), _name))
}
Пример #4
0
func (window *Window) GetData(name string, userdata unsafe.Pointer) unsafe.Pointer {
	_window := (*C.SDL_Window)(unsafe.Pointer(window))
	_name := (C.CString)(name)
	return (unsafe.Pointer)(C.SDL_GetWindowData(_window, _name))
}