Can I use GLEW without requiring GLU?

Started by
3 comments, last by TheBuzzSaw 13 years, 4 months ago
I never use GLU functionality anymore, but I've become a big fan of GLEW. I've had a couple people unable to compile my project because they did not have GLU installed yet (Ubuntu users). Is there a way to effectively disable GLU in GLEW? I suppose I could edit the GLEW header to not include GLU, but I think that violates the license, and GLEW seems to have lots of preprocessor directives. Maybe it has one I don't know about... ?
Amateurs practice until they do it right.Professionals practice until they never do it wrong.
Advertisement
I don't think it uses GLU. GLEW just gets function pointers..
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);
The file glew.h makes a direct attempt to include glu.h. I doubt the rest of GLEW makes any use of it, but it does include the header file. :(
Amateurs practice until they do it right.Professionals practice until they never do it wrong.
Remove it. Also, email the developer to remove it.

//edit: actually, I think they include it because GLU include gl.h and if someone in their source includes glu.h before glew.h, then you get preprocessor messages from GLEW complaining. In your case, just comment out GLU.h
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);
That makes sense. They need to add a directive.

#define I_PROMISE_NOT_TO_INCLUDE_GLU


But yeah, I read the license details up top. It turns out they do allow modification. I think I'll just comment out that block.
Amateurs practice until they do it right.Professionals practice until they never do it wrong.

This topic is closed to new replies.

Advertisement