Sign in to follow this  

using macros to call opengl extensions

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

I read here that giving a pointer to an opengl extension the same name as the extension itself can cause linking issues on some platforms. I was wondering if anybody knows if it's safe to give a macro the same name as an opnegl extension, like this:

void (APIENTRY * pglBlendEquationEXT) (GLenum) = NULL; //pointer to glBlendEquationEXT() function


//define a macro used to call an opengl extension with the same name as the macro
#define glBlendEquationEXT(arg) pglBlendEquationEXT(arg)


Share this post


Link to post
Share on other sites
It's perfectly fine to do it this way.

The only time it would cause an issue at the link stage is if the function is actually defined somewhere. However, the entire point of setting up a function pointer, etc. is that the function is NOT defined, so you should be all good.

Share this post


Link to post
Share on other sites

This topic is 3555 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this