[SDL] X11: event window and rendering window differ, how to work around this?

Tomas Carnecky tom at dbservice.com
Thu Aug 24 15:11:00 PDT 2006


It seems like SDL creates two different windows, one to receive
(key-)events and one to render the data to. Unfortunately this breaks my
 little application which hooks all XEvent functions and when the user
presses a predefined key combination, it saves the dpy/win and starts
capturing from the window: when the app calls glXSwapBuffers, it checks
if the user has enabled capturing and saves the image (glReadPixels).
But because the 'win' arguments differ, glXSwapBuffers never finds out
that the user activated the capturing. I can work around this by
'overriding' the events and simply capture everything that the
application calls glXSwapBuffers on, but that isn't very elegant as the
user can't stop capturing and needs to exit/restart the application.

Does anyone have an idea how I could work around this, preferably
without having to hook a SDL function?

thanks
tom




More information about the SDL mailing list