mirror of
https://github.com/kevinbentley/Descent3.git
synced 2025-01-22 11:28:56 +00:00
Some more SDL1.2 -> SDL2 work. Mouse input doesn't suck now!
This commit is contained in:
parent
001a533399
commit
f739edff3d
@ -356,19 +356,12 @@ int sdlKeyFilter(const SDL_Event *event) {
|
||||
switch (event->key.state) {
|
||||
case SDL_PRESSED:
|
||||
kc = sdlkeycode_to_keycode(event->key.keysym.sym);
|
||||
#if 0 // !!! FIXME: migrate from SDL 1.2
|
||||
if (event->key.keysym.mod & KMOD_CTRL) {
|
||||
switch (kc) {
|
||||
case KEY_G: // toggle grabbed input.
|
||||
if (ddio_mouseGrabbed) {
|
||||
SDL_WM_GrabInput(SDL_GRAB_OFF);
|
||||
ddio_mouseGrabbed = false;
|
||||
} // if
|
||||
else {
|
||||
SDL_WM_GrabInput(SDL_GRAB_ON);
|
||||
ddio_mouseGrabbed = true;
|
||||
} // else
|
||||
return (0);
|
||||
ddio_mouseGrabbed = !ddio_mouseGrabbed;
|
||||
SDL_SetRelativeMouseMode(ddio_mouseGrabbed ? SDL_TRUE : SDL_FALSE);
|
||||
return 0;
|
||||
|
||||
#ifdef __PERMIT_GL_LOGGING
|
||||
case KEY_INSERT:
|
||||
@ -392,11 +385,17 @@ int sdlKeyFilter(const SDL_Event *event) {
|
||||
|
||||
else if (event->key.keysym.mod & KMOD_ALT) {
|
||||
if ((kc == KEY_ENTER) || (kc == KEY_PADENTER)) {
|
||||
SDL_WM_ToggleFullScreen(SDL_GetVideoSurface());
|
||||
return (0);
|
||||
extern SDL_Window *GSDLWindow;
|
||||
Uint32 flags = SDL_GetWindowFlags(GSDLWindow);
|
||||
if (flags & SDL_WINDOW_FULLSCREEN) {
|
||||
flags &= ~SDL_WINDOW_FULLSCREEN_DESKTOP;
|
||||
} else {
|
||||
flags |= SDL_WINDOW_FULLSCREEN; // !!! FIXME: FULLSCREEN_DESKTOP
|
||||
}
|
||||
SDL_SetWindowFullscreen(GSDLWindow, flags);
|
||||
return(0);
|
||||
} // if
|
||||
} // else if
|
||||
#endif
|
||||
|
||||
LKeys[kc].down_time = timer_GetTime();
|
||||
LKeys[kc].status = true;
|
||||
|
@ -715,10 +715,7 @@ int opengl_Setup(oeApplication *app, int *width, int *height) {
|
||||
ddio_mouseGrabbed = true;
|
||||
}
|
||||
|
||||
if (ddio_mouseGrabbed) {
|
||||
SDL_ShowCursor( 0 );
|
||||
SDL_SetWindowGrab(GSDLWindow, SDL_TRUE);
|
||||
}
|
||||
SDL_SetRelativeMouseMode(ddio_mouseGrabbed ? SDL_TRUE : SDL_FALSE);
|
||||
|
||||
// rcg09182000 gamma fun.
|
||||
// rcg01112000 --nogamma fun.
|
||||
|
Loading…
Reference in New Issue
Block a user