Version 5 (modified by sam, 8 years ago) (diff)

OpenGL version numbers

The road to OpenGL 4.0 and other transitions

Notes about various OpenGL versions.

OpenGL headers

GLEW

#include <glew.h>

Most other OpenGL platforms

Including Linux, Windows.

#define GL_GLEXT_PROTOTYPES
#include <GL/gl.h>

Mac OS X

Check for both __APPLE__ and __MACH__.

#define MACOS_OPENGL
#define GL_GLEXT_PROTOTYPES
#include <OpenGL/OpenGL.h>
#include <OpenGL/gl.h>
#include <OpenGL/glext.h>

OpenGL ES headers

Most OpenGL ES platforms

Android, NaCl.

#include <GLES2/gl2.h>
#include <GLES2/gl2ext.h>

Apple iOS

#include <OpenGLES/ES2/gl.h>
#include <OpenGLES/ES2/glext.h>

Old OpenGL ES 1.x systems

#include <GLES/gl.h>
#include <GLES/glext.h>

PSGL

Will include GLES/gl.h in turn.

#include <PSGL/psgl.h>
#include <PSGL/psglu.h>

Version Macros

OpenGL

All versions of OpenGL provide a version number in addition to the previous versions:

#define GL_VERSION_1_1 1
#define GL_VERSION_1_2 1
#define GL_VERSION_1_2_1 1
#define GL_VERSION_1_3 1
#define GL_VERSION_1_4 1
#define GL_VERSION_1_5 1

#define GL_VERSION_2_0 1
#define GL_VERSION_2_1 1

#define GL_VERSION_3_0 1
#define GL_VERSION_3_1 1
#define GL_VERSION_3_2 1
#define GL_VERSION_3_3 1

#define GL_VERSION_4_0 1
#define GL_VERSION_4_1 1

OpenGL ES 1.0

#define GL_OES_VERSION_1_0 1

OpenGL ES 1.1

#define GL_VERSION_ES_CM_1_0 1
#define GL_VERSION_ES_CL_1_0 1
#define GL_VERSION_ES_CM_1_1 1
#define GL_VERSION_ES_CL_1_1 1

OpenGL ES 2.0

#define GL_ES_VERSION_2_0 1