[SDL] SDL_thread and OpenGL on OS X

Steaphan Greene stea at cs.binghamton.edu
Sat Apr 28 04:48:32 PDT 2007


On Sat, Apr 28, 2007 at 10:22:22AM +0200, Daniel Bünzli wrote:
> 
> Le 28 avr. 07 à 00:49, Martin Storsjö a écrit :
> 
> > If I remember correctly, the GL context is thread specific. I'm not 
> > sure whether you can share the same context in many threads, or if 
> > you'll need to create a new context for that thread. All of this is 
> > platform specific, too.
> 
> No, I don't think it is a problem, there's no gl magic in a thread.  
> Just make sure your threads acquire a lock before calling any (section 
> of) gl* commands to mutually exclude them from accessing the OpenGL 
> engine.

I am quite sure that it IS a requirement in SDL-1.2 that only one thread 
ever access the video system.  This is a platform dependent requirement 
(some platforms can tolerate code disobeying this requirement, some can 
not), so you may not have noticed it, depending on what platforms you 
work with.  However, to be sure SDL will work everywhere it is supposed 
to, only one thread (the one that initializes SDL, generally the initial 
thread) can ever access video.

-- 
Steaphan Greene <sgreene at cs.binghamton.edu>
Lecturer, Computer Science, Binghamton University
GPG public key: http://www.cs.binghamton.edu/~sgreene/gpg.key.txt
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20070428/97fffa45/attachment.pgp 


More information about the SDL mailing list