Talk:Tutorial1: Creating a Cross Platform OpenGL 3.2 Context in SDL (C / SDL)
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)
gl3.h incompatibilities with Linux
gl3.h did not work on linux for me. And it did not work in a very weird way: all calls to glClearColor produced only a green color no matter what color I specified. In any case it seems that we should be using GLEW instead of gl3.h and I have updated the tutorial to that effect. --Sunnyps 13:19, 19 February 2011 (CST)