# OpenGL OpenGl extensions

This topic is 4843 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Ok, I have used extensions before but only in my small projects. Mainly I want to make it so I can get the pointers to all the extensions functinos once and then use them in multiple files / classes. Currently I whenever I try to init the functions and then include that in multiple or any other classes / files it gives me lots of errors. If I just define them in the class itself it works fine but then when I go to another class I have to change the name I want to use for the function pointer. Say for Mult texturing I use PFNGLACTIVETEXTUREARBPROC glActiveTextureARB = NULL; in one class / file, I then in another have to use PFNGLACTIVETEXTUREARBPROC glActiveTextureARB1 = NULL; // notice the 1 at the end of the function without the 1 I get error saying its already defined. I hope this isn't to confusing, I think its more of a problem with me still not great at including files. I do use #ifndef #define and #endif with all my header files though. Basically I am putting together all of my smaller projects into an actual game / engine and I want to do it the right way -THACO

##### Share on other sites
My advice would be to get an extensions loader (such as GLee, see Forum FAQ) and use it to load all the extensions as instructed, it'll probably mean reworking your code a bit but it should be a better solution

##### Share on other sites
Well it looks like I just can't read properly
I already did look into GLEW and GLee but looking around I assumed it just made it easier to initialize but that is because I assumed below where it says "glMultiTexCoord2fARB(...); //safe to use multitexture" it ment that is where I would then get the pointer to the function, not actually use the function.

#include <gl\GLee.h>          //no need to link to gl.h ...if (GLEE_ARB_multitexture)    //is multitexture support available?{  glMultiTexCoord2fARB(...);  //safe to use multitexture}else{   //fallback}

Now I udnerstand that for the glMultiTexCoord2fARB(...) is that the actual function I can use

I just realized after double checking that GLee was not what I was looking for.
Any reason to use GLee over GLew or vice versa?

THACO

1. 1
Rutin
47
2. 2
3. 3
4. 4
5. 5

• 10
• 27
• 20
• 9
• 20
• ### Forum Statistics

• Total Topics
633405
• Total Posts
3011682
• ### Who's Online (See full list)

There are no registered users currently online

×