GLEW instructions failes on multithread

Started by
2 comments, last by Kiranatus 14 years, 4 months ago
Hello, I have multithreaded OpenGL usage (there is no other way). But there is no problem with it. But in each thread I have load .dll with GLEW instructions. The problem was in usage of those dll functions. When I try to use some of the GLEW intstructions I have exception. Strange because I have call glewInit() after creating OpenGL context. Ok, now I call glewInit() each time. It seems to work now. But this is not a good way (as I think). Can it be solved some how? Or if I choose multithread way - there is no another way? Added: glewInit() does not help. I have exception again. Thanks. [Edited by - Kiranatus on December 22, 2009 2:59:30 AM]
Advertisement
It crashes at different moments of time. I use global crit. section to be sure that only one context active at a time. However it crashes. Crashes and crashes. What I have missed?
Did you recompile GLEW?
http://glew.sourceforge.net/advanced.html

Multiple Rendering Contexts (GLEW MX)
explains that shit.
Sig: http://glhlib.sourceforge.net
an open source GLU replacement library. Much more modern than GLU.
float matrix[16], inverse_matrix[16];
glhLoadIdentityf2(matrix);
glhTranslatef2(matrix, 0.0, 0.0, 5.0);
glhRotateAboutXf2(matrix, angleInRadians);
glhScalef2(matrix, 1.0, 1.0, -1.0);
glhQuickInvertMatrixf2(matrix, inverse_matrix);
glUniformMatrix4fv(uniformLocation1, 1, FALSE, matrix);
glUniformMatrix4fv(uniformLocation2, 1, FALSE, inverse_matrix);
Thanks, I will try. Does anyone has an experience in using GLEW with multithreading? What the most wide-spread problem in this?

This topic is closed to new replies.

Advertisement