[SDL] OpenGL in threads?

St0fF 64 st0ff at gmx.net
Mon Mar 11 18:15:01 PST 2002


At 21:39 11.03.2002 +0000, you wrote:
>Can SDL run with one thread for drawing in OpenGL, one thread for 
>event-handling, one thread... ? I it can, what am I doing wrong?
>
>main()
>{
>
>SDL_Init(SDL_INIT_VIDEO);
>gfx = SDL_CreateThread (graphics_thread, NULL);
>
>events = SDL_CreateThread (events_thread, NULL);
>
>SDL_WaitThread(gfx, NULL);
>SDL_WaitThread(events, NULL);
>
>SDL_Quit ();
>}
I'm not quite sure, but this program looks like you have some wrong 
thoughts.  Try to make this main do the events-processing-loop ... and not 
quit after initializing the threads.  I guess, SDL is already finished when 
your event-thread tries to use it ... but as I said, I'm not sure and I 
don't have any thread-experience.
St0fF.





More information about the SDL mailing list