mirror of
https://github.com/digarok/gsplus.git
synced 2025-02-20 02:28:57 +00:00
only grab mouse in fullscreen for now
This commit is contained in:
parent
48bad8a432
commit
6ec560ca49
@ -395,8 +395,7 @@ void dev_video_init_sdl() {
|
|||||||
|
|
||||||
// Turn off host mouse cursor
|
// Turn off host mouse cursor
|
||||||
SDL_ShowCursor(SDL_DISABLE);
|
SDL_ShowCursor(SDL_DISABLE);
|
||||||
SDL_SetWindowGrab(window, true);
|
//SDL_SetRelativeMouseMode(true);
|
||||||
SDL_SetRelativeMouseMode(true);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -596,10 +595,12 @@ void handle_sdl_key_event(SDL_Event event) {
|
|||||||
if (!is_up) {
|
if (!is_up) {
|
||||||
if (!IsFullScreen(window)) {
|
if (!IsFullScreen(window)) {
|
||||||
glog("Enable fullscreen");
|
glog("Enable fullscreen");
|
||||||
|
SDL_SetWindowGrab(window, true);
|
||||||
SDL_SetWindowFullscreen(window, SDL_WINDOW_FULLSCREEN_DESKTOP);
|
SDL_SetWindowFullscreen(window, SDL_WINDOW_FULLSCREEN_DESKTOP);
|
||||||
} else {
|
} else {
|
||||||
glog("Disable fullscreen");
|
glog("Disable fullscreen");
|
||||||
SDL_SetWindowFullscreen(window, 0);
|
SDL_SetWindowFullscreen(window, 0);
|
||||||
|
SDL_SetWindowGrab(window, false);
|
||||||
SDL_SetWindowSize(window, BASE_WINDOW_WIDTH, X_A2_WINDOW_HEIGHT);
|
SDL_SetWindowSize(window, BASE_WINDOW_WIDTH, X_A2_WINDOW_HEIGHT);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user