Where to get an up-to-date OpenGL32.lib? - c++

this one drives me crazy. I've been searching for two days but cant find any answer.
I want to develop some things with OpenGL 3 (or newer) with Visual Studio 2010 / C++.
The header and libraries provided by Microsoft are way too old to support OpenGL 3, so I'm trying to find newer versions. I easily found the header file in the OpenGL registry (http://www.opengl.org/registry/) but I cant find the OpenGL32.lib anywhere. How am I supposed to link a program without it?

There isn't a newer OpenGL library for windows, and there won't be. They decided to stop at OpenGL 1.1 and even call it a legacy graphics.
However, you can use load opengl function, and that is how people get access to the latest opengl features.
You can also use GLEW library to get access to the opengl functions.

Related

Setting up modern OpenGL with Visual Studio 2013

I have been coding OpenGL for a while now using Java and LWJGL. However recently I decided that I would switch from Java to C++.
I managed to set up OpenGL with Visual Studio 2013, and had some fun with that. However I am used to using modern OpenGL (shaders, vbo's, vao's etc...), and I believe what I am looking for is OpenGL ES.
I have been using the GLFW library to create a window with OpenGL context, so how do I do this with OpenGL ES.
I tried adding the #define GLFW_INCLUDE_ES31 line to above the glfw3.h include, however then it cannot find the GLES3/gl31.h header file. I don't know how to obtain this file on my computer, because the GL/gl.h file was just on my computer by default.
Am I supposed to download it?
Apparently OpenGL ES is aimed at smartphones or less powerful devices, so I was wrong in thinking I wanted to use OpenGL ES. In that case, how can I use these newer functions within Visual Studio, and C++. At the moment I only seem to have access to OpenGL 1.1 functions.
You are lacking a loader (GLEW for example)
"just" add it to your project and you will be able to use the GL_ functions again

Where to download opengl sdk (v. 3 or v. 4)?

Wikipedia says that OpenGl V4.x is the latest. However my Visual Studio 2012 just offers the following version
#define GL_VERSION_1_1 1
So my questions:
Which version is the most common that I should use? E.g. version 2.x because there are many tutorials, it is backward compatible etc.? I may have to mention that I normally prefer to write in C++, so is any version of Opengl e.g. offering namespaces? Are there huge differences between OpenGl 2,3 and 4?
And where can I get the Libs+Header files e.g. for OpenGl 4?
And where can I get the Libs+Header files e.g. for OpenGl 4?
You don't. OpenGL uses the so called "extension mechanism" to load functionality that's beyond the system ABI version. There exist third party libraries that do the extension loading and provide a header with the extended functionality.
Most popular is GLEW, which has its homepage at http://glew.sourceforge.net ; be warned though that right now of writing this GLEW is not up to date with OpenGL-3 and later core profiles. You must use compatibility profiles with GLEW or things get unstable.
AFAIK, the most popular GL development library is GLEW:
http://glew.sourceforge.net
There is no official OpenGL SDK. If you want to use newer functions you have to use a third party library such as GLEW or GLFW.

OpenGL in WIndows7

I want to write code in OpenGL using Visual Studio 2010 . Now on opening opengl.org , I am redirected to http://user.xmission.com/~nate/glut.html ; which presumes I am using WindowsXP and Visual Studio 6 . The instructions in this page http://user.xmission.com/~nate/glut/README-win32.txt dates back to 2001 , and not in current context .
Long story short, is there any tutorial which will help me to program with OpenGL in Windows 7 using Visual Studio 2010 .
Thanks in advance for taking the time to answer my question . I am new to this , so please bear with me.
OpenGL development under Window-7 is the very same as it has been for Windows-NT 4, Windows 2k and Windows XP. All the tutorials remain valid.
You do not require a OpenGL SDK. Everything you need ships with your compiler. OpenGL is not a library, but an API implemented by the drivers. So make sure you download and install the most recent drivers directly from your GPU's vendor's homepage (don't use the drivers shipping with Windows, because those have only very limited support for OpenGL).
Since you surely want to use recent OpenGL functionality you should however get the GLEW library, which eases up the loading process for the so called "extensions" by several orders of magnitude; highly recommended. Then instead of the regular OpenGL header you include GL/glew.h and call glewInit() right after an OpenGL context has been made active.
Instead of the old, outdated, no longer maintained GLUT, you should use FreeGLUT or OpenGLUT; if using GLUT at all, because you'll hit its limitations very soon. I recommend using GLFW instead.
First of all, configure your project to link with opengl32.lib etc.:
OpenGL config in Visual Studio 2010.
Look at some NeHe tutorials http://nehe.gamedev.net/.
What about Visual Studio 2010 and Windows 7 - I don't think there is some significant differences in API with previous versions of Visual Studio and Windows (at least for simple examples).
Also look at: OpenGL API Documentation Overview

Setup VisualC++ to use OpenGL 4.1?

I'm trying to setup VC++ to compile code with OpenGL 4.1 functionality. I downloaded the 3 header files from from opengl.org; put them in the correct paths and include them - but keep getting errors like this:
error C3861: 'wglSwapIntervalEXT': identifier not found
I have the latest video drivers. OpenGL says the problem is MS includes only version 1.1 with their compiler when though the vendor/driver supports 4.1.
One of the big pains of using OpenGL on Windows is that the Windows SDK only ships with OpenGL 1.1. There's probably a really good technical (and non-political) reason for this, but the fact remains, if you want to do anything with OpenGL on Windows, you're on your own.
What you need then, is something to bring the Windows SDK up to current standards (OpenGL 4.1 as I write this.) When I was originally trying to solve this problem (around the time of OpenGL 3.0), I came across GLee http://elf-stone.com/glee.php which is a cool library which makes the full OpenGL spec available easily. I didn't like their license, so I decided to write my own extension loader.
I don't think anyone should ever have to do this again, so I've made mine public domain, do with it as you will. I'd like to hear if you use it in something, but that's not a requirement.
http://www.onemanmmo.com/index.php?cmd=newsitem&comment=news.1.28.0

how to link OpenGL with VC++

I am developing one game where I want to add OpenGL framework with VC++ 2005 express edition. But I dont know how to add OpenGL framework with VC++. So can any one guide me for this.
Please explain me in detail.
Thanks in advance
You must link with opengl32.lib and potentially glu32.lib. The headers should already be provided with the Platform SDK (which needs to be downloaded separately, if you don't already have it).
If possible, you should consider upgrading to VS2008 Express, since it's free.
You need to have a windowing toolkit before you can use opengl. GLUT is the easiest to learn/use for begining with opengl. Here is a guide to download GLUT and how to create an opengl project.
http://www.cecs.csulb.edu/~pnguyen/Using%20OpenGL%20in%20Visual%20Studio%202005.htm
You should have all of the opengl libs and headers already so you should only need to download glut.