Talk:Tutorial1: Creating a Cross Platform OpenGL 3.2 Context in SDL (C / SDL)

From OpenGL Wiki
Jump to navigation Jump to search

Not fully comaptible with Win32?

I tested this tutorial using Visual Studio 2008 under Win7 x64. It seems that the GL3.h is not compatible with Windows. Microsofts OpenGL32.lib is AFAIK a OpenGL 1.1 version. This should be the problem that the linker can't find the symbols of the newer functions such as glGenBuffers().

Then I thought I could replace the gl3.h with glew.h. After that the code compiles fine but I only get a compatibility profile context. This Tutorial 1 works but Tutorial 2 (using VBOs) fails because of access violations whenaccessing the OpenGL 3.2 core profile functions. -- Michaelvs 14:50, 13 March 2010 (UTC)

I found the problem why it was not working. I forgot to call glewInit() after the context creation.
To make the tutorial compatible with the windows platform you have to include glew.h (part of GLEW Library instead of gl3.h (which seems not to be compatible with the OpenGL32.lib of Windows). And then call glewInit() (see the Tutorial at GLEW Website) after calling SDL_GL_createContext(). -- Michaelvs 15:17, 13 March 2010 (UTC)