Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

opengl, how to best update headers with visual studio?

Tags:

c++

opengl

I'm having a bit of an issue updating my GL headers. Basically I want to access the function glCompressedTexImage2D but my gl headers are really old and I don't believe that function exists in those headers. So I've tried to update my gl.h file but I get loads of errors. I've tried updating my graphics card software among other things. Can anyone be of help?

like image 222
Bushes Avatar asked Dec 19 '11 11:12

Bushes


People also ask

Does Visual Studio support OpenGL?

Step 1: GLUT Installation (only needs to be done once) back to top ↑ Windows comes with OpenGL, and Visual Studio comes with the OpenGL libraries, but neither of them comes with GLUT. Get the newest version of GLUT here: GLUT 3.7. 6 for Windows.

Where to get OpenGL32 lib?

The OpenGL library can usually be found by the name opengl32. dll under the \system32 folder, located in your system's root folder (usually c:\windows). Headers compatible with OpenGL are bundled with most compilers.

How do I open an OpenGL project in Visual Studio?

In Visual Studio, right-click on your project, and select "Open Folder in File Explorer...". A folder will appear that contains the files for your project. Drag the openGL files from the folder you created in step 1, into this folder.


1 Answers

I'm having a bit of an issue updating my GL headers.

That's because you're not supposed to do this. In Windows anything beyond OpenGL-1.1 is gathered through the extension mechanism. The easiest way to access this is through GLEW. Install this and use GL/glew.h instead of the regular GL/gl.h. Then after a OpenGL context has been created the first thing to call is glewInit().

like image 187
datenwolf Avatar answered Sep 28 '22 12:09

datenwolf