There seems to be some issues on MacOS X involving multiple SetVideoMode
calls and the mouse’s state. If you create a window, and then try to
recreate a new one, the cursor’s grab state and/or visibility seems to get
munged up.
Minimal test case: comment the SDL_PumpEvents() call to make this “work”.
If the PumpEvents is there, the mouse gets hosed. I specified SDL_NOFRAME
and SDL_OPENGL (since this is what the ut2003 splash screen/main window
use), but I think that it’s just a matter of forcing SDL to destroy one
window and create another by changing a significant property such as
whether it has a title bar or not, etc.
Any insight?
Thanks,
–ryan.
// build with "gcc -o test test.c sdl-config --cflagssdl-config --libs
There seems to be some issues on MacOS X involving multiple
SetVideoMode
calls and the mouse’s state. If you create a window, and then try to
recreate a new one, the cursor’s grab state and/or visibility seems to
get
munged up.
Minimal test case: comment the SDL_PumpEvents() call to make this
"work".
If the PumpEvents is there, the mouse gets hosed. I specified
SDL_NOFRAME
and SDL_OPENGL (since this is what the ut2003 splash screen/main window
use), but I think that it’s just a matter of forcing SDL to destroy one
window and create another by changing a significant property such as
whether it has a title bar or not, etc.
Any insight?
The cursor is always shown when unsetting the video mode. I put this in
there so apps can’t quit and leave the cursor hidden (which would be
really annoying to users).
I really put this in the wrong place, in QZ_UnsetVideoMode(). I’m
moving it to QZ_VideoQuit(). This fixes the problem.
Note: This patch also comments out a line I thought might be the
problem (before I really found the problem). This line should be
commented out (or removed) because it fixes an error in the release of
the window that can cause a double release and will cause a crash.