Example of using "glBlendEquation"

I’m looking for any example of source code where is used subroutine glBlendEquation. Thank’s for any help. Sorry for my English :frowning:

Did you search google? Or the red book? I’m sure you can find its code somewhere (probably in this site too). Also nehe has a lot of tutorials. Maybe it’s used in there somewhere.

Yes I did but I couldn’t find. In i “glext.h” :

GLAPI void APIENTRY glBlendEquation (GLenum);

glBlendEquation is not declare as pointer, how I should load this function ??

See this thread:

It talks about using shaders, but the same applies to every other extension or post-1.1 function.

Your way is correct. But you use a function pointer. I can declare glBlendEquation as a pointer :


and load it using wglGetProcAddress(“glBlendEquation”).
Is there any other possibility, using declaration in “glext.h” ??

I wouldn’t recommend it, but on Linux you can #define GL_GLEXT_PROTOTYPES before including “glext.h”, then you should be able to just use it.

But then your program will not work at all on systems that don’t support this function, it will just fail to start without any chance for you to use a fallback path or at least print a user friendly error message…

This method will also not work on Windows, and I don’t know if it will work on Mac. Bypassing the extension loading mechanism should not be done because it is not portable.

If you’re looking for an easy way to load the function pointers, look for an extension loading library like glew.

That explains a lot :slight_smile: . Thank You for help.