GLEW doesn't implement function on windows, GLEE does but doesn't work right on mac...

Started by
4 comments, last by scippie 12 years, 4 months ago
Hi,

As I am advancing in developing a game engine, I am getting in need of Geometry shading support to generate data in a new vertex buffer.
First I developped a version on Windows, and then I ported the code to Mac (osx 10.7)
On the Mac, I couldn't get it to work and it seemed that GLEE was to blame for nog being complete on the matter.
So I switched to GLEW and I got it to work.

Now: the extension I am using will no longer work on windows, while it used to work with GLEE on windows. *sigh*

For example, I am trying to do this:
static const char *varying_names[] = { "gl_Position", "vOutDirection" };
glTransformFeedbackVaryingsEXT(id, 2, varying_names, GL_INTERLEAVED_ATTRIBS);


This is how it works on the mac, but now, on windows, I get an access violation on address 0 on this call. After doing some investigation, it seems that GLEW doesn't enable the GL_EXT_transform_feedback extension on windows.

On my windows machine however, the latest opengl drivers are installed and are supported by my graphics adapter (GeForce 580). And if you don't believe it, I did got the code to work with GLEE but it might be that I had used the non-EXT version then.
If I use the non-EXT version now with GLEW, it also doesn't work: Then I get the linker error: error LNK2001: unresolved external symbol __imp____glewTransformFeedbackVaryings
In this case, it also seems that GLEW thinks my driver doesn't support it.

Anyone?

By the way, the reason that GLEE would no longer suffice on the mac is that function: glGetQueryObjectuiv would not be available for querying how many primitives had been generated by the geometry shader.
Another by the way: GLEE thinks that the third parameter of glTransformFeedbackVaryings is an array of GLint's, while it isn't. You can see that if you test it with an array of some random numbers, for example: { 3 }. It will give a access violation reading at address 3. It worked with GLee if the string-array was cast to (GLint*)
Advertisement
That's called a link error. It has nothing to do with drivers.
Your glew32.lib file doesn't contain TransformFeedbackVaryings. You should update it.
Get it from glew.sourceforge.net

GLEE is dead.
http://www.opengl.org/wiki/OpenGL_Loading_Library#GLee
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's called a link error. It has nothing to do with drivers.
Your glew32.lib file doesn't contain TransformFeedbackVaryings. You should update it.
Get it from glew.sourceforge.net

GLEE is dead.
http://www.opengl.or...ng_Library#GLee


I downloaded glew today and just linked in the glew.c file into my project, so that can't be the problem...

That's called a link error. It has nothing to do with drivers.
Your glew32.lib file doesn't contain TransformFeedbackVaryings. You should update it.
Get it from glew.sourceforge.net

GLEE is dead.
http://www.opengl.or...ng_Library#GLee


And AFAIK, it does have to do with the drivers/system, as GLEW will not GetProcAddress on a function that is not supported by the system. And that seems to be the case here.

And AFAIK, it does have to do with the drivers/system, as GLEW will not GetProcAddress on a function that is not supported by the system. And that seems to be the case here.

How? The OP is getting a linker error, so the program can't even be built and run, let alone call GetProcAddress.

The way I solved glew problems (which in my experience only seem to happen in Windows, in Linux everything is smoooooth. I use MinGW by the way, might be different in Visual Studio) is by including glew.c in my project, as you have done, and then put

// You could be lazy and put it in glew.c directly :P
#ifndef GLEW_STATIC
#define GLEW_STATIC
#endif

before including glew.h, so it's staticly built with the executable.

Hope this helps!

How? The OP is getting a linker error, so the program can't even be built and run, let alone call GetProcAddress.


Now you've made me feel stupid :-)

Of course that couldn't work during the compilation/linking phase, where did I get that stupid idea. I'm not that dumb though :-)

Anyway, I think I must have mixed some things together, as now I can make it work on both glee and glew. I didn't need to add your #ifdefs although I link it right into my project just like you do it.

Thanks for your help.

This topic is closed to new replies.

Advertisement