Jump to content
  • Advertisement
Sign in to follow this  
THACO

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.

If you intended to correct an error in the post then please contact us.

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 this post


Link to post
Share on other sites
Advertisement
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 this post


Link to post
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

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!