Example #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)
}
Example #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))
}
Example #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))
}