Getting SDL keyevents to work with NeHe Tutorial 32
This is based on NeHe Lesson 32, the shooting gallery.
The main "game" loop is in NeHeGL.c, where I'd like to have SDL handling key events. Lesson32.c however has OpenGL handling keyevents, and this seems to catch all keyevents that would be passed to the SDL keyevent buffer.
The OpenGL initialization method called in NeHeGL.c is: (/code) BOOL Initialize (GL_Window* window, Keys* keys) (\code)
Is there a way to call an OpenGL initialization that won't disrupt the SDL keyevent grabber in the main loop?
1. OpenGL doesn't handle key event's.
2. it is the fuction "WindowProc" that contains the main loop that does this, somewhere in that big switch statement.
read this http://www.libsdl.org/cgi/docwiki.cgi/SDL_5fGetKeyState
I have little experience with SDL but it looks straightforward enough.
2. it is the fuction "WindowProc" that contains the main loop that does this, somewhere in that big switch statement.
read this http://www.libsdl.org/cgi/docwiki.cgi/SDL_5fGetKeyState
I have little experience with SDL but it looks straightforward enough.
www.flashbang.se | www.thegeekstate.com | nehe.gamedev.net | glAux fix for lesson 6 | [twitter]thegeekstate[/twitter]
I see what you mean by WindowProc, not OpenGL, intercepting keyboard events (and every other thinkable event). I found that the NeHeGL SDL pack on their website takes over most of what WindowProc does, I just need to integrate it into my program.
[Edited by - ScottNCSU on July 15, 2005 10:29:58 PM]
[Edited by - ScottNCSU on July 15, 2005 10:29:58 PM]
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement