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

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -