Jump to content
  • Advertisement
Sign in to follow this  
wolfscaptain

OpenGL OpenGL extensions

This topic is 2878 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

I am trying to make updated OpenGL bindings for Ruby.
What I want to do is parse gl3.h directly from the source (as in, download the file at real time) in order for the bindings to stay automatically updated.

Anyhow, here are a few questions about getting the extension entry points:

1) What's the deal with Windows returning NULL for entry points obviously existing? (using wglGetProcAddress of course)
If I set my function pointer to the equivalent gl call (say PFNGLENABLEPROC Enable = glEnable) everything works as expected, yet I can't get the pointers at real time.

I vaguely remember reading somewhere that wgl does that with the supported OS version.
As far as I know, XP and Vista and above have different versions (1.1 and 1.2, no?), so I'll actually need to check this?

Does this stuff happen also with glX?
And I don't even have any idea how to work on Macs, so I hope it isn't as lame as Windows and Linux!

2) Since glGetString with GL_EXTENSIONS is deprecated, is there still a way to "throw away" extensions without checking each of their separate function entry points?
For instance, if I don't have GL_ARB_framebuffer_object, I obviously don't want to check all the frame buffer functions for no reason, but I can't get how to do that without using GL_EXTENSIONS.

3) Did anyone notice all those
/* reuse GL_some_constant */
lines?
Should I parse them, somehow, or just let them be?
If I have a "reuse" it should probably mean that I must have support for the original constants, right?

Thanks :)

[edit]

By the way, in case the "throw away" part isn't understood, I mean when actually initializing the entry points after using some library to create a context.
I could use Ruby to just delete the methods that do not exist, and I would like to just throw them in groups if possible.

Share this post


Link to post
Share on other sites
Advertisement
1) wglGetProcAddress doesn't work on GL 1.1 functions. That's for GL 1.2 and above and yes, use wglGetProcAddress.
Do the same for Linux (get function pointers for GL >1.1)
I don't know about Mac. Isn't that a FreeBSD system? glXProcAddress?

2) Yes, glGetString(GL_EXTENSIONS) is deprecated.
Now
glGetIntegerv(GL_NUM_EXTENSION, &number);
for(i=0; i<number; i++)
{
uchar *ext_string=glGetStringi(GL_EXTENSIONS, i);
do what you want with ext_string
}

BTW, GL_ARB_framebuffer_object is core GL 3.0.

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!