Sign in to follow this  

using macros to call opengl extensions

Recommended Posts

lol    139
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
taby    1265
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

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