Ejemplo n.º 1
0
func (win *Window) SetData(name string, data interface{}) interface{} {
	cname := C.CString(name)
	defer C.free(unsafe.Pointer(cname))

	pd := C.SDL_SetWindowData(win.c, cname, unsafe.Pointer(&data))
	if pd == nil {
		return nil
	}

	return *(*interface{})(pd)
}
Ejemplo n.º 2
0
func (window *Window) SetData(name string, userdata unsafe.Pointer) unsafe.Pointer {
	_window := (*C.SDL_Window)(unsafe.Pointer(window))
	_name := C.CString(name)
	defer C.free(unsafe.Pointer(_name))
	return (unsafe.Pointer)(C.SDL_SetWindowData(_window, _name, userdata))
}
Ejemplo n.º 3
0
// Window (https://wiki.libsdl.org/SDL_SetWindowData)
func (window *Window) SetData(name string, userdata unsafe.Pointer) unsafe.Pointer {
	_name := C.CString(name)
	return unsafe.Pointer(C.SDL_SetWindowData(window.cptr(), _name, userdata))
}