thread resource loading

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.

See here:

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

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 for full details on what is shared between contexts.

Regards,
Patrick