glGenVertexArrays not available in c++ - c++

As i have already programmed with opengl on java I tried to switch to c++ using Visual Studio 2015 Community
I currently have opengl version 4.5 installed (cout << glGetString(GL_VERSION))
I normally have included all libraries I need for programming but for some reason there is no "glGenVertexArrays" and "glGenBufferArrays" available
Could it be that I forgot a library?

On windows, the default header files and libs do only support OpenGL 1.1. When you want to use a higher version, you have to load the extensions manually or use an extension loading library like glew (which I would recommend).

Related

Using AMD OpenCL with mingw

I have downloaded and installed AMD APP SDK 3.0. When I try using it with mingw I get an error because CL/cl.hpp has #include <intrin.h> in it (this header is exclusive to VC++).
Is there a different set of header files for mingw? How do I fix it?
I use both MSVC and MinGw 5.3.0 (bundled with QtCreator) to build OpenCL apps on both Intel and AMD Windows 10 systems using AMD APP SDK 3.0 and I have never experienced a build problem that wasn't in my own code!
However, I use the standard C CL/cl.h header file, not the C++ CL/cl.hpp header file...
The cl.hpp and cl2.hpp files provide C++ bindings for the standard C functions, see OpenCL C++ Bindings. If you don't require C++ bindings, the AMD APP SDK 3.0 CL/cl.h header file works fine.
If you want to use C++ Bindings then note that cl.hpp is obsolete; you should use cl2.hpp instead (which doesn't try to include intrin.h unless _MSC_VER is defined)...
An alternative OpenCL C++ binding (that also compiles with MinGw and AMD APP SDK 3.0) is boost compute.

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

What version of OpenGL comes with Visual Studio 2012 Express?

How do you install GLUT and OpenGL in Visual Studio 2012? explains that the OpenGL headers and libraries come with VS2012. How do I determine which versions of the OpenGL standard are supported by these libraries? I recently purchased the 8th Edition of the OpenGL redbook which is based on OpenGL 4.3. Will I be able to run and compile these examples with VS2012 Express?
OpenGL implementation is brought to you by your graphics card driver, not by your OS (except really old stuff). When you install the GPU driver, appropriate library (such as nvogl32.dll on my PC with NVidia card) is placed in your System32/SysWOW64 folder.
To actually acess the functions in the driver, you need a loader library (such as GLload or GLEW) that will ask the driver dll nicely where do the functions reside. You can also do it manually, but it's extremely cumbersome.
You can access the opengl version in runtime via:
glGetString(GL_VERSION)
after opening a gl context. Other usefull information about this gl call here

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.

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

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.