• Advertisement
Sign in to follow this  

using macros to call opengl extensions

This topic is 3628 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
Advertisement
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
Sign in to follow this  

  • Advertisement