Beispiel #1
0
func TrapMouse(trap bool) {
	if trap {
		C.SDL_SetWindowGrab(win, C.SDL_TRUE)
	} else {
		C.SDL_SetWindowGrab(win, C.SDL_FALSE)
	}
}
Beispiel #2
0
func (w *Window) SetGrab(grab bool) {
	if grab {
		C.SDL_SetWindowGrab(w.win, 1)
	} else {
		C.SDL_SetWindowGrab(w.win, 0)
	}
}
Beispiel #3
0
func (win *Window) SetGrab(grab bool) {
	cgrab := C.SDL_bool(C.SDL_FALSE)
	if grab {
		cgrab = C.SDL_TRUE
	}

	C.SDL_SetWindowGrab(win.c, cgrab)
}
Beispiel #4
0
func (w *Window) SetGrab(grabbed bool) {
	C.SDL_SetWindowGrab(w.cWindow, C.SDL_bool(bool2int(grabbed)))
}
Beispiel #5
0
func (window *Window) SetGrab(grabbed bool) {
	_window := (*C.SDL_Window)(unsafe.Pointer(window))
	_grabbed := (C.SDL_bool)(Btoi(grabbed))
	C.SDL_SetWindowGrab(_window, _grabbed)
}
Beispiel #6
0
// Window (https://wiki.libsdl.org/SDL_SetWindowGrab)
func (window *Window) SetGrab(grabbed bool) {
	C.SDL_SetWindowGrab(window.cptr(), C.SDL_bool((Btoi(grabbed))))
}
Beispiel #7
0
// ReleaseInputFocus releases input focus for the window.
func (win *Window) ReleaseInputFocus() {
	C.SDL_SetWindowGrab(win.cWin, C.SDL_FALSE)
}
Beispiel #8
0
// GrabInputFocus grabs input focus for the window.
func (win *Window) GrabInputFocus() {
	C.SDL_SetWindowGrab(win.cWin, C.SDL_TRUE)
}