Jump to content
  • Advertisement
Sign in to follow this  
Trillian

OpenGL up-to-date header files

This topic is 4233 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! I was working on my engine and coding some vertex buffers. I wanted to use the glDrawRangeElements function, the problem was that visual studio couldn't find it. This function exists in the documentation but not in my header files (gl.h and such), which look like they are from 1996. So I went on the internet looking for more up-to-date version of gl.h and the other header files (they must update glext.h once a while!) but couldn't find them. I remembered having hard times doing so. Where on the internet can I find an up-to-date version of all gl headers (and maybe .lib and .dll but I guess the .dll are updated by the graphics drivers (?))? How come doesn't opengl.org have these headers on their front page or something, I mean that's how you can use opengl! Thanks!

Share this post


Link to post
Share on other sites
Advertisement
Trillian,
glDrawRangeElements() is defined in OpenGL v1.2. So you need to include glext.h file in your project. You can get it from;
http://oss.sgi.com/projects/ogl-sample/sdk.html

Also, you have to declare the pointer to glDrawRangeElements() and get the actual address from the driver after including glext.h:
#include "glext.h"
...
// function pointer to OpenGL extensions
PFNGLDRAWRANGEELEMENTSPROC glDrawRangeElements = 0;
...
// get function pointer to glDrawRangeElements before use
glDrawRangeElements = (PFNGLDRAWRANGEELEMENTSPROC)wglGetProcAddress("glDrawRangeElements");
...



You would recommend checking if the video driver supports v1.2 or greater. But I am pretty sure most video cards nowadays are greater than 1.2.

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!