I’m trying to get an SDL window to re-paint while it’s being dragged (this is
in Windows, using SDL 1.2.13 and OpenGL).
I’ve seen a workaround proposed where an event filter is installed, and then
a render function is called from the event filter in response to
SDL_VIDEOEXPOSE events. I gather this is generally considered inadvisable
for thread safety reasons.
However, here’s what I’m wondering. My understanding (which may be
incorrect) is that the Windows ‘message proc’ function is always called from
the thread that created the window. Also, from looking at the SDL code it
appears that SDL_VIDEOEXPOSE events are only dispatched to the event filter
from the message proc.
It seems it would follow then that in Windows, if you receive an
SDL_VIDEOEXPOSE event in your event filter, you’re guaranteed to be in the
main thread, in which case it would be safe to call SDL video functions.
Am I overlooking anything here? Or is this workaround indeed safe as long as
it’s confined to Windows operating systems?–
View this message in context: http://www.nabble.com/Calling-video-functions-from-SDL-event-filter-tp22494437p22494437.html
Sent from the SDL mailing list archive at Nabble.com.