Multithreading on UNIX with OpenGl -


i want load assets opengl application in separate thread can create loading screen, when try call opengl function in thread, application crashes, , need them load textures. there anyway can use multithreading , opengl? or going say, load asset every frame, , make screen kinda choppy , bad looking? i've seen can accomplish on windows, want run on unix (specifically macosx) more windows.

messing single opengl context in different threads bound result in trouble. can though make use of pixel buffer object (pbo) texture update, map in main (opengl) thread, pass mapped pointer loading thread filled file contents, , unmap pbo followed glteximage2d (using pbo, of course) in main thread once loading thread has finished. using 2 different pbos, 1 filled loading thread , 1 copied texture main thread , proper synchronization, can file loading , texture update work concurrently (look @ linked tutorial some, yet single-threaded, examples).


Comments