SDL + OpenGL + Win32 is NOT th-(


I actually develop a framework using SDL and OpenGL.
I had a crash in the NVidia (I have a GeForce DDR) driver, which was an
access violation (trying to acces 0x80 address :-(( )
I was using
and updateScreen is the function where the GL instructions stands.
In the main thread was the message loop.
After hours I tried to directly call updateScreen after each message and
then it works.

Yes, video is generally not thread-safe on any platform. If you want
thread-safe video you’ll need to carefully coordinate where you do video
functions and make sure you don’t call video functions by multiple threads
simultaneously. Some environments will just plain fail if you try to do
video from any thread but the main one. I recommend that if you multi-thread
your game, that you use a separate thread for logic rather than a separate
thread for video. Instead of updating video from a timer, update it from
your main loop and do the appropriate timing calculations.

Multi-threading is in general a huge amount of work to get right, and isn’t
usually worth the effort. Make sure you have joined a good multi-threaded
programming forum and plan to rewrite your code a few times as you learn the
subtleties involved.

See ya!
-Sam Lantinga, Lead Programmer, Loki Entertainment Software