GL Extension setup

Started by
1 comment, last by James Trotter 18 years, 7 months ago
If I initialize: extern PFNGLACTIVETEXTUREARBPROC glActiveTextureARB; extern PFNGLCLIENTACTIVETEXTUREARBPROC glClientActiveTextureARB; I get error: `void (*glActiveTextureARB)(GLenum)' redeclared as different kind of symbol /usr/include/GL/gl.h:2056: error: previous declaration of `void glActiveTextureARB(GLenum)' Terrain.h:56: error: declaration of `void (*glActiveTextureARB)(GLenum)' /usr/include/GL/gl.h:2056: error: conflicts with previous declaration `void glActiveTextureARB(GLenum)' Terrain.h:57: error: `void (*glClientActiveTextureARB)(GLenum)' redeclared as different kind of symbol /usr/include/GL/gl.h:2057: error: previous declaration of `void glClientActiveTextureARB(GLenum)' Terrain.h:57: error: declaration of `void (*glClientActiveTextureARB)(GLenum)' /usr/include/GL/gl.h:2057: error: conflicts with previous declaration `void glClientActiveTextureARB(GLenum)' and when trying to use `glXGetProcAddressARB' I get 'undeclared (first use this function)' glActiveTextureARB = (PFNGLACTIVETEXTUREARBPROC)glXGetProcAddressARB("glActiveTextureARB"); I'm using GLEW with Linux Fed Core 3 with Mesa OpenGL 6.2.1. I've checked Extensions are supported by running glGetString(GL_EXTENSIONS)); So I'm a bit lost at this point as to how I set up Extension support. I would be eternally grateful for any help. Kind Regards
Advertisement
I don't have any advice for your current program, but you should definitly take a look into using GLEE for your GL Extension setup. Here's a quick thread why [wink]
If, as you say, you're using GLEW, then there should be no need to initialize the functions in such a manner. GLEW actually handles everything for you and makes it unbelievably simple. Just calling glewInit() will initialize all the functions you need. Also, to check if a specific extension is available, instead of searching the GL_EXTENSIONS string, you can simply use the following code:

if (GLEW_VERSION_1_3) {  // OpenGL version 1.3 functionality is available.} else if (GLEW_ARB_multitexture) {  // ARB_multitexture functionality is available.} else {  // Multitexturing is not supported}


Note: Glee is actually more or less identical to GLEW in its usage, and I don't think there's a significant difference between the two. So you should be fine with either.

This topic is closed to new replies.

Advertisement