Jump to content
  • Advertisement
Sign in to follow this  
moetman

OpenGL GL Extension setup

This topic is 4819 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

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

Share this post


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

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!