c++ - OpenGL functions fails in multithread application -
why sometimes after next calls:
takeopengl(); glgettexlevelparameteriv(gl_texture_2d, 0, gl_texture_width, &texturewidth); glgettexlevelparameteriv(gl_texture_2d, 0, gl_texture_height, &textureheight); freeopengl(); variables texture* have incorrect values?
im using opengl mutex, doing next:
void takeopengl(){ opengl.enter(); wglmakecurrent(hdc, hrc); } void freeopengl(){ opengl.leave(); wglmakecurrent(0, 0); } what problems?
you can't call wglmakecurrent without holding mutex. freeopengl function this.
Comments
Post a Comment