Ejemplo n.º 1
0
func Mouserelative() (int, int, uint32) {
	var x C.int
	var y C.int
	state := C.SDL_GetRelativeMouseState(&x, &y)
	C.SDL_SetRelativeMouseMode(C.SDL_TRUE)
	return int(x), int(y), uint32(state)
	/*
		state := C.SDL_GetMouseState(&x,&y)
		C.SDL_WarpMouseInWindow(win, 100,100)
		return int(x)-100,int(y)-100,uint32(state)
	*/
}
Ejemplo n.º 2
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
}
Ejemplo n.º 3
0
func SetRelativeMouseMode(enabled bool) bool {
	return int(C.SDL_SetRelativeMouseMode(C.SDL_bool(bool2int(enabled)))) == 0
}
Ejemplo n.º 4
0
func SetRelativeMouseMode(enabled bool) int {
	_enabled := (C.SDL_bool)(Btoi(enabled))
	return (int)(C.SDL_SetRelativeMouseMode(_enabled))
}
Ejemplo n.º 5
0
// SetRelativeMouseMode (https://wiki.libsdl.org/SDL_SetRelativeMouseMode)
func SetRelativeMouseMode(enabled bool) int {
	return int(C.SDL_SetRelativeMouseMode(C.SDL_bool(Btoi(enabled))))
}