OpenGL glGenTextures multithreading not working (with SDL) -
i have id variable of opengl texture identificator. generate glgentextures (1, &id) , works fine. problem when call glgentextures function in different thread. return 0 , not generate texture. think because opengl context different.
i use sdl load image , pass texture glteximage2d. i'm trying create new sdl_glcontext in thread share main thread, don't how make it. can modify id inside thread id=2 example, , read , print it, can't modify glgentextures , can't generate texture need.
an opengl context can active in 1 thread @ time. can't bind single opengl context in multiple threads. possible create second opengl context shares opengl resource namespace , bind in thread. or use pixel buffer objects (pbos) map opengl memory process address space, , fill other thread.
Comments
Post a Comment