Jump to content
  • Advertisement
Sign in to follow this  
scippie

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

This topic is 2560 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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*)

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites

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...

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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!

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!