glext.h not working properly
Hi there , I started OpenGL programming in C (.net) a while ago. Some OpenGL functions (such as glActiveTexture , originally defined in glext.h) wouldn't work properly (undeclared identifier error) unless I added lines like this in my code:
PFNGLACTIVETEXTUREPROC glActiveTexture =(PFNGLACTIVETEXTUREPROC) wglGetProcAddress ("glActiveTexture");
It didn't matter much then because the functions were few. Now I started programming in GLSL and I need many functions defined in glext.h , and it is rather inconvenient to do the above for every single function I need to use. How is it possible to have these functions properly defined in glext.h as they should?
Quote:Original post by GorgiWelcome to the wonderful world of OpenGL Extensions! [smile]
Hi there , I started OpenGL programming in C (.net) a while ago. Some OpenGL functions (such as glActiveTexture , originally defined in glext.h) wouldn't work properly (undeclared identifier error) unless I added lines like this in my code:
PFNGLACTIVETEXTUREPROC glActiveTexture =(PFNGLACTIVETEXTUREPROC) wglGetProcAddress ("glActiveTexture");
It didn't matter much then because the functions were few. Now I started programming in GLSL and I need many functions defined in glext.h , and it is rather inconvenient to do the above for every single function I need to use. How is it possible to have these functions properly defined in glext.h as they should?
As you've found out, including glext.h isn't all you need to do. You still need to get a pointer to the functions so that you can actually use them. I recommend, instead of doing all that manually, just use an extension loading library such as GLee or GLEW. It is much less of a hassle that way.
Instead of repeating this everytime, read the wiki or show them the way to the wiki http://www.opengl.org/discussion_boards/ubb/ultimatebb.php?ubb=get_topic;f=3;t=014353
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement