Jump to content
  • Advertisement
Sign in to follow this  
Seroja

OpenGL OpenGL versions

This topic is 4839 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 wonder, is there some place that I can get OpenGL headers for each version (e.g. 1.0, 1.1, 1.2 and so on)? Or at least a header for 1.0 or 1.1, and then the additions for each version (plain-text declarations, not specifications from OpenGL.org). The additions are basically extensions, right? But I suppose they are functions present in the OpenGL DLL, that you can call. I'm declaring all functions manually in VB.Net, and I'd like to classify them by version. And how do I check if OpenGL is present at all (other than checking that opengl32.dll is present, I might end up crashing because it's just a dummy file)? And if it is, will the glGetString(GL_VERSION) work on the very first implementation? (Same about GLU). Thanks in advance.

Share this post


Link to post
Share on other sites
Advertisement
Anything post version 1.1 is indeed accessed like an extension in the windows world as the DLL hasnt be upgraded, as such the only functions you can call directly on the opengl32.dll are the OpenGL 1.1 functions.

Getting a copy of the glext.h should give you all the tokens you need for versions post-1.1 (google for it, I belive its on one of sgi's sites)

You'll be hard pressed to find a machine without basic opengl support these days, MS has been shipping OpenGL1.1 since windows98 was released and on some versions of Win95 as well, as such creating a very basic OpenGL context and issuing the glGetString(GL_VENDOR) should work (it will return a string with Microsoft in it if its not hardware accelerated).
By a basic context I mean just a 16bit color window, default everything else to 0 and let the implimentation decide (you might need to set the z-buffer to 16 as well), once you've got it created and all the extensions loaded you destory it and then you can make a REAL window once you know what you've got to work with.

Share this post


Link to post
Share on other sites
Quote:
Original post by _the_phantom_
Anything post version 1.1 is indeed accessed like an extension in the windows world as the DLL hasnt be upgraded, as such the only functions you can call directly on the opengl32.dll are the OpenGL 1.1 functions.


< Sighs loudly > When will Microsoft finally catch up to the rest of the world? My new copy of Mac OS X came with the whole of OpenGL 2.0 in core.

Share this post


Link to post
Share on other sites
They have no intrest in it basically, they provide a core which frankly is all thats needed, extension loading libraries such as a GLee (see Forum FAQ) take any hastle out of it.
MS are just happy to put all their effort into making D3D more OpenGL like [grin], however Longhorn will have an OpenGL1.3 DLL shipped with it... only a couple of years late as the spec will be on 2.1 by then *chuckles*

Share this post


Link to post
Share on other sites
So, what you say is that the end-user has OpenGL 1.1 is a safe assumption. Even if not, I should make a catch block on the first function called from OpenGL, and after I get the version by glGetString I'm fine. Oh, and if I install the DLL I have with my program, will it work? That would be easier :)

And what about GLU? I think some computers don't have it, and I think 1.0 doesn't even let you check the version (I might be wrong here...).
BTW I'd rather convert it's code to VB, I only need a few functions from there, so can the source be found somewhere?

I have OpenGL 1.1 headers. But where are the extensions located physically? What DLL can I declare them from, or is function pointers the only way? And I need the constants declared anyway. They are prsent in glext.h, but it's rather difficult to sort them out by version, hasn't it been done already?

Share this post


Link to post
Share on other sites
Quote:
Original post by Seroja
So, what you say is that the end-user has OpenGL 1.1 is a safe assumption. Even if not, I should make a catch block on the first function called from OpenGL, and after I get the version by glGetString I'm fine. Oh, and if I install the DLL I have with my program, will it work? That would be easier :)


yes, 1.1 is a safe assumption, if the user doesnt have OpenGL on their machine the inital context creation will fail anyways (which you should be checking for) so you cant call any OGL functions anyways.
Which dll are you on about? If you are on about the opengl32.dll on your system, then no, you shouldnt distrubute it and it could cause bad things to happen.

Quote:

And what about GLU? I think some computers don't have it, and I think 1.0 doesn't even let you check the version (I might be wrong here...).
BTW I'd rather convert it's code to VB, I only need a few functions from there, so can the source be found somewhere?


I belive the source code for GLU does exist online, it'll be in C ofcourse, just google for it. However you dont have to worry about the end user having GLU installed, GLU is a static lib meaning its compiled into your application when you make it (from a C point of view), afaik no DLL version of it exists.

Quote:

I have OpenGL 1.1 headers. But where are the extensions located physically? What DLL can I declare them from, or is function pointers the only way? And I need the constants declared anyway. They are prsent in glext.h, but it's rather difficult to sort them out by version, hasn't it been done already?


The extensions are physically located in the gfx card driver's opengl compoent so the only way todo it is to get the address of the function to use, there isnt just one dll to link to beyond opengl32.dll.
Sorting by version isnt really needed as most people query based on extension availbity rather than reported OpenGL version.
I think the headers which come with GLee (see Forum FAQ) are split into GL versions however, if not then you'll have to grab a copy of the spec and work out what extensions became prompted to core in which version of OGL.

Share this post


Link to post
Share on other sites
Quote:
Original post by _the_phantom_
I belive the source code for GLU does exist online, it'll be in C ofcourse, just google for it. However you dont have to worry about the end user having GLU installed, GLU is a static lib meaning its compiled into your application when you make it (from a C point of view), afaik no DLL version of it exists.

I've got glu32.dll in my windows\system dir, and I'm using it :-)
The source is over SGI's sample implementation, but I couldn't figure out the license type. Oh, and if I convert the whole code to VB, will that mean that it's derivated work? There won't be anything of the original code :-)

What's static linking? Is there such a thing in VB? I've been using dynamic linking all the time.

So, no way around function pointers... Can I use them in VB.Net? Only way I know is CallWindowProc API, but that's probably windows-specific, and not so easy to use either.

Share this post


Link to post
Share on other sites
Quote:
Original post by vNistelrooy
I think it is time to learn C++..


Surely not. VB is better :P
Almost everything that can be done in C++ can be done in VB.Net. Some stuff has to be done in an ugly way (like those function pointers), but I'd say working with forms using callback functions is an ugly way as well :-)

Share this post


Link to post
Share on other sites
Quote:
Original post by Seroja
So, no way around function pointers... Can I use them in VB.Net? Only way I know is CallWindowProc API, but that's probably windows-specific, and not so easy to use either.

If you're already using VB.Net you're already windows specific, so I wouldn't worry about that. (And no, mono does not mean you're doing cross-platform code).

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!