Jump to content
  • Advertisement
Sign in to follow this  
Graham11

OpenGL Whose gl.h?

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

Hello everyone, I've programmed graphics for years, but am still confused by a simple puzzle. I'm using Visual Studio 2003, Windows 2000, and an NVidia 6800GT. When I once again download the latest version of NVidia's SDK, I see as always that there is a new version of gl.h inside. However, there is also a gl.h file in the Microsoft Platform SDK. As it seems opengl32.lib from Microsoft is the library to link to, which gl.h header file should I use; Microsoft's or NVidia's? Thanks in advance, Graham

Share this post


Link to post
Share on other sites
Advertisement
Quote:
Original post by Cypher19
I'd use the NV SDK as it's probably more up-to-date.


Although that might not help you much when opengl32.lib is the same old... Why don't you run a diff, compare the files? If there's nothing you actually need that's in the NVidia SDK OpenGL header, which isn't in the ordinary header, then there's probably no reason to use it.

Share this post


Link to post
Share on other sites
I would use the standard gl.h, and the glext.h files from openGL.org.

The NVidia headers are no good. The only extra you get from NVIdia's headers are some obscure definition you will probarbly not use. The last time i installed the NVidia headers they had thing like NV_TEXTURE_RECTANGLE, but you don't need that since there is also an ARB_TEXTURE_RECTANGLE. I should update from OpenGL.org.

Hope this makes sense.

Share this post


Link to post
Share on other sites
Quote:
Original post by Dybbuk
I would use the standard gl.h, and the glext.h files from openGL.org.

Right. And even then, for extension definitions and such, I would use a library like GLEW or GLee.

Share this post


Link to post
Share on other sites
Thanks. Some mixed answers there. When I download other APIs, a header file will have a specific dll library it works with. Surely that would argue against using an updated version of gl.h; if the same dll is being used anyway?

Thing is, I'm still confused. I guess for gl extensions, nvidia/ati's driver dlls are used, but what about core gl changes...how can a new nvidia gl.h, update core functionality?

Cheers,
Graham

Share this post


Link to post
Share on other sites
Quote:
Original post by Graham11
Thanks. Some mixed answers there. When I download other APIs, a header file will have a specific dll library it works with. Surely that would argue against using an updated version of gl.h; if the same dll is being used anyway?

Thing is, I'm still confused. I guess for gl extensions, nvidia/ati's driver dlls are used, but what about core gl changes...how can a new nvidia gl.h, update core functionality?

Cheers,
Graham


ATI and Nvidia drivers implement the entire OpenGL functionality: core and extensions. They have to, as they should try to make all functions use their hardware as efficiently as possible. You should also realize that the implementation can change without modifying the headers. These headers just define what all functions look like (in terms of parameters and stuff) their implementations can (and probably do) differ significantly between drivers.

That being said, I would like to put my vote in for GLEW (and probably GLee, although I don't have experience with that). These projects both provide an excellent way of solving the GL header nightmare on Windows (you need to pick only one).

Tom

Share this post


Link to post
Share on other sites
Thanks Tom. GLEW also gets my vote. But what about Microsoft's opengl32.dll? Does it just pass instructions through to the driver dlls?

Graham

Share this post


Link to post
Share on other sites
Quote:
Original post by Graham11
Thanks Tom. GLEW also gets my vote. But what about Microsoft's opengl32.dll? Does it just pass instructions through to the driver dlls?

Graham


I'm definitely not an expert on this, but I think it does. That's why GLEW, besides defining the header contents for all current OpenGL versions (upto 2.0 right now), also needs to use wglGetProcAddress() to get the adresses of all functions not defined by version 1.1 (which is the version implemented by Windows). My guess is that the function pointers returned by that function come directly from the driver rather than OpenGL32.dll.

Tom

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!