The first and most important thing to understand is that OpenGL is not a software library. There are no official and common headers, .libs, .dlls available that will provide access to OpenGL. OpenGL is provided by your hardware manufacturer as part of their drivers, and so the first thing to do is: download and install the latest drivers from your hardware manufacturer.
-> I have download it and setup followings(I use Quadro FX 5800)
-> 341.81-quadro-grid-desktop-notebook-win8-win7-64bit-international-whql.exe
* This is driver from nvidia
* After this setup on my desktop computer, there is changed in Windows\System32 such as nvogl[v32.dll, v64.dll, shim32.dll, shim64.dll] and so on.
-> NVIDIA_SDK10_OpenGL_10.52.0808.1735.exe
* This is a SDK Library for nvidia and sample code.
* I have try to insert below code in Example Source code downloaded.
- printf("OpenGL version : %s
", (char*)glGetString(GL_VERSION));
But, It still prints “OpenGL version : 3.3.0”.
In my opinion, I need to get opengl32.dll for the version I want(4.2 or higher).
-> When I have been looking for this problem to solve it, I found one thing(please, refer below).
- 398191-opengl32dll-nvidia-drivers/
for nvidia (+ winxp/2000) the opengl driver is called nv_oglnt.dll (or something similar from memory) basically that does all the work,
opengl32.dll is the 100% software driver or redirects u to nv_oglnt.dll if u have nvidia drivers installed
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- Is this means that opengl32.dll is intermediate file for driver’s .dll like nvogl.dll?
The next thing to understand is that the OpenGL version you get is determined by (1) your hardware, and (2) your drivers. For example, and at the time of writing, AMD drivers only support up to OpenGL 4.4 whereas Intel only support up to 4.3 (both support some, but not all, features from higher versions), and older hardware from all manufacturers will (of course) only support lower versions. Current AMD hardware is capable of supporting 4.5 and should do so (via updated drivers) at some point in the future; don’t know about Intel. Sometimes a manufacturer will provide software emulation of features they don’t support in hardware, but that’s typically not worth bothering with: your performance can drop to under 1 frame per second.
What this means is that if your hardware and drivers don’t support the OpenGL version you wish to use, then you can’t use that OpenGL version.
-> I believe that I already have appropriate drivers because I setup latest driver downloaded from nvidia.
So, I think that so long as I get opengl32.dll for lastest version, I can use this. Is my notion alright?
Since you’re talking about Windows and Visual Studio, the next thing to understand is that Visual Studio only provides headers and .libs for OpenGL version 1.1 - nothing higher. With all versions of Visual Studio (except for Visual C++ 2005 Express, which was weird) the full procedure for setting it up to program OpenGL 1.1 is: do nothing. It’s built-in, there’s nothing you need to do, and if you start cutting and pasting headers, .libs and .dlls around to different folders you’ll only make a mess and break it.
So in your program you then just #include <gl/gl.h>, link to opengl32.lib and start writing code.
This is important because subsequent versions of OpenGL build on previous versions: if you can’t get a working OpenGL 1.1 program, then you’ll never get a working OpenGL 4.5 program, so focus on getting 1.1 working first.
-> I can compile and execute my program using opengl, but It use 3.3 as mentioned above.
To access higher versions you then need to do one of two things. The hard way is to make a bunch of wglGetProcAddress calls - in your program, after you’ve created your OpenGL context - for all of the entry points you wish to use. This is tedious and error-prone.
-> Sorry, I can’t understand your advice. But sincerely thank you.
The easy way is to use a 3rd-party library like GLEW which will do it all for you.
Download links for GLEW: sourceforge
How to install GLEW: glew.sourceforge
How to use GLEW in your program: glew.sourceforge
-> Because you mention the GLEW, I download it and GLUT.
And I include these include/lib directory in my new project(VS2010) for using opengl.
I found Windows SDK(Software Development Kit) at below URL and setup it on my pc
* msdn.microsoft
Following setting up this, I have files in C:\Program Files (x86)\Windows Kits\8.1.
It contains many folders such as Include, Lib, Bin, and so on.
At C:\Program Files (x86)\Windows Kits\8.1\Include\um\gl, I found GL.h and GLU.h.
At C:\Program Files (x86)\Windows Kits\8.1\Lib\winv6.3\um\x86, I found GlU32.Lib and opengl32.lib.
I can’t find GLU32.DLL or opengl32.dll at C:\Program Files (x86)\Windows Kits\8.1\bin.
I create two folders such as “Include” and “Lib” in My new project solution folder.
I copy GL.h and GLU.h in Windows Kits folder to “Include” I created.
And I also copy GLU32.Lib and opengl32.lib in Windows Kits folder to “Lib” I created.
To use these files, I am setting up property in my new project(VS).
I did these work(setting for include and lib directory) for GLEW(C:\glew-1.12.0) and GLUT(C:\glut-3.7).
Now, I have latest version of library such as GLEW, GLUT, GLU32 and opengl32.
I include and link these files in my project.
Below code are the part of my code.
--------------------------------------------------------------------------------------------------------------------------------
for Include
#include <glew_1.12.0_GL/glew.h> // It indicates “C:\glew-1.12.0\include\glew_1.12.0_GL”. I change folder name “GL” to “glew_1.12.0_GL” to avoid confusion.
#include <gl.h> // It indicates “—\Visual Studio 2010\Projects\OpenGL_LinkEx\Include\Windows_Kit_gl\GL.h”
#include <glu.h> // It indicates “—\Visual Studio 2010\Projects\OpenGL_LinkEx\Include\Windows_Kit_gl\GLU.h”
#include <glut.h>// It indicates “C:\glut-3.7.6-bin\glut.h”
for main
void main()
{
glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH);
glutInitWindowSize(400, 400);
glutCreateWindow("Hellow OpenGL");
initRendering();
glutDisplayFunc(Display);
glutReshapeFunc(Reshape);
printf("OpenGL version : %s
", (char*)glGetString(GL_VERSION));
glutMainLoop();
}
--------------------------------------------------------------------------------------------------------------------------------
I feel frustrated a little bit because it also prints "OpenGL version : 3.3.0".
A useful resource is the OpenGL Extensions Viewer () which you can use to determine which OpenGL version your hardware and driver supports.
-> It’s GOOD!! I knew this not at all.
I wrote a long article to solve it. And I want to use latest version so much.
I have try many thing.
- Setting up Windows SDK.
- Setting up GLEW.
- Setting up GLUT.
- Setting up (appropriate)Driver from Nvidia.
So, What do I miss? I too wonder how can I solve this problem.
Please, let me know any solution.
I am very grateful to you.