A question about glBlendColorEXT

Started by
1 comment, last by zsunshine 20 years, 1 month ago
Hello! I''m working on the Bluescreening with OGL. My question is why glBlendColorEXT always leads the program crashes. My code is as follows: #include <gl\gl.h> #include <gl\glut.h> #include <gl\glu.h> #include <gl\glaux.h> #include "glext.h" typedef void (APIENTRY *PFNGLBLENDCOLORPROC)(GLclampf red, GLclampf green,GLclampf blue, GLclampf alpha); PFNGLBLENDCOLORPROC glBlendColorEXT = (PFNGLBLENDCOLORPROC) wglGetProcAddress("glBlendColorEXT"); ...... void render(void) { ... glBindTexture(GL_TEXTURE_2D, 0); glEnable(GL_BLEND); glBlendFunc(GL_ONE,GL_CONSTANT_ALPHA_EXT); glBlendColorEXT(0.0F, 0.0F, 1.0F, 1.0F); //draw something.... ... } My program works fine if glBlendColorEXT does not exist. Please help!!! Thanks!
Advertisement
You need to create the redering context before getting the function pointers. In other words, you cannot initialize the function pointer in file scope like that.
Thank you!
Problem solved by using GLee!

This topic is closed to new replies.

Advertisement