Opengl, what is the best way to update headers with visual studio?

I have a problem updating GL headers. Mostly I want to access the function glCompressedTexImage2D, but my gl headers are really old, and I don't think the function exists in these headers. So I tried to update the file gl.h, but I got a lot of errors. I tried updating software for graphics cards, among other things. Can anyone help?

+5
source share
4 answers

I have a little problem updating GL headers.

, . Windows , OpenGL-1.1, . - GLEW. GL/glew.h GL/gl.h. OpenGL , , glewInit().

+5

, Windows OpenGL (1.2?). GLEW Glee, (GL_ARB_TEXTURE_COMPRESSION glCompressedTexImage2D). , .

GLEE:

#include <gl/GLee.h>          

if (GLEE_ARB_TEXTURE_COMPRESSION)
{
    glCompressedTexImage2D(...);  
}
else
{
     // the extension is not available, use a different method
}

, GLEE , ( GLEW). . , :), , , ( ), .

+3

, , , :

PFNGLCOMPRESSEDTEXIMAGE2DPROC p = NULL;
const char* string = glGetString(GL_EXTENSIONS);

if (strstr(string, "GL_ARB_texture_compression") != NULL)
   p = (PFNGLCOMPRESSEDTEXIMAGE2DPROC)wglGetProcAddress("glCompressedTexImage2D");
+1

: http://www.opengl.org/registry/ glext.h wglext.h

. Windows OpenGL 1.1.

GLEW (GLEE , ...)

0

All Articles