The SDL forums have moved to discourse.libsdl.org.
This is just a read-only archive of the previous forums, to keep old links working.
SDL
Simple Directmedia Layer Forums
glActiveTexture declaration
MindFlyer
Joined: 27 Sep 2009
Posts: 36
Posted: Fri Nov 11, 2016 3:30 am
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 `glActiveTexture@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?
Re: glActiveTexture declaration
MindFlyer
Joined: 27 Sep 2009
Posts: 36
Posted: Fri Nov 11, 2016 3:34 am
MindFlyer wrote:
The way I fixed it is by going into SDL_opengl.h and deleting line 2019:
GLAPI void GLAPIENTRY glActiveTextureARB(GLenum texture);