Discussion:
[SDL] glActiveTexture declaration
MindFlyer
2016-11-11 03:30:05 UTC
Permalink
I am using SDL2 with CodeBlocks/MinGW/gcc, and I have a problem with glActiveTexture. If I call this function without declaring it, it says "undefined reference to `***@4'". If I declare it as PFNGLACTIVETEXTUREPROC glActiveTexture, it says "'glActiveTexture' redeclared as different kind of symbol".

The way I fixed it is by going into SDL_opengl.h and deleting line 2019:
GLAPI void GLAPIENTRY glActiveTextureARB(GLenum texture);

Now I do
PFNGLACTIVETEXTUREPROC glActiveTexture = (PFNGLACTIVETEXTUREPROC) SDL_GL_GetProcAddress("glActiveTexture");
and everything works fine.

But I'm pretty sure this shouldn't happen. Every other OpenGL function is either loaded automatically or I can declare it no problem. For some reason only glActiveTexture is giving me a headache.
Is this a bug with SDL2 or my OpenGL driver, or am I doing something wrong?
MindFlyer
2016-11-11 03:34:02 UTC
Permalink
Post by MindFlyer
GLAPI void GLAPIENTRY glActiveTextureARB(GLenum texture);
Typo. It's line 1871:
GLAPI void GLAPIENTRY glActiveTexture( GLenum texture );

Loading...