Exemplo n.º 1
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)
}
Exemplo n.º 2
0
func (win *Window) SetFullscreen(fs bool) error {
	cfs := C.SDL_bool(C.SDL_FALSE)
	if fs {
		cfs = C.SDL_TRUE
	}

	if C.SDL_SetWindowFullscreen(win.c, cfs) != 0 {
		return getError()
	}

	return nil
}
Exemplo n.º 3
0
func SetRelativeMouseMode(e bool) error {
	ce := C.SDL_bool(C.SDL_FALSE)
	if e {
		ce = C.SDL_TRUE
	}

	if C.SDL_SetRelativeMouseMode(ce) != 0 {
		return getError()
	}

	return nil
}
Exemplo n.º 4
0
func SetRelativeMouseMode(enabled bool) bool {
	return int(C.SDL_SetRelativeMouseMode(C.SDL_bool(bool2int(enabled)))) == 0
}
Exemplo n.º 5
0
func (w *Window) SetGrab(grabbed bool) {
	C.SDL_SetWindowGrab(w.cWindow, C.SDL_bool(bool2int(grabbed)))
}
Exemplo n.º 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))))
}
Exemplo n.º 7
0
// SetRelativeMouseMode (https://wiki.libsdl.org/SDL_SetRelativeMouseMode)
func SetRelativeMouseMode(enabled bool) int {
	return int(C.SDL_SetRelativeMouseMode(C.SDL_bool(Btoi(enabled))))
}