View Full Version : Restrict OpenGL to core functionalities.
04-11-2012, 12:17 PM
I take a look at the forum but didn't finding anything about it. In the learning process of OpenGL many tutorials use OpenGL 2.1 (glBegin, glEnd, etc). Is there a way to restrict the available functions to only the core version and avoid the deprecated with some compiler error?
04-11-2012, 12:45 PM
You create a core context. And in GLSL use "#version 330 core" . That's all.
No compiler error will be generated, just a crash on calling a function that wglGetProcAddress naturally returned NULL for, or a glGetError() returning invalid_enum after using some existing deprecated functions.
04-11-2012, 12:58 PM
Well, you could include a header that only provides the core functions (and extensions). Most OpenGL Loading Libraries (http://www.opengl.org/wiki/OpenGL_Loading_Library) don't provide these, but some do. GL3w only offers core functions, and the Unofficial GL SDK offers both core and compatibility headers.
Powered by vBulletin® Version 4.2.3 Copyright © 2017 vBulletin Solutions, Inc. All rights reserved.