PDA

View Full Version : thread resource loading



ugluk
06-28-2010, 05:05 PM
I just wanted to make a VBO within a thread my main thread spawns and got a nice segfault for it. I'd like to know what resources I can load in a spawned thread and share with the main thread.

I'd like the main thread show a splah screen or a GUI, while I load resources (textures/geometry...) from the spawned thread.

eile
06-29-2010, 12:07 AM
See here:

http://hacksoflife.blogspot.com/2008/02/creating-opengl-objects-in-second.html
http://www.equalizergraphics.com/documentation/parallelOpenGLFAQ.html

pjcozzi
06-29-2010, 07:39 AM
Your main thread and the loading thread each need an OpenGL context that are shared. Most "big" GL resources (VBOs, textures, shaders) can be created on the loader thread then used in the main thread but "small" container objects like VAOs, FBOs, and occlusion queries cannot. See the spec (http://www.opengl.org/registry/) for full details on what is shared between contexts.

Regards,
Patrick