Pass context profile mask and context flags to init functions.

They will be needed to decide if GL functions are deprecated or removed.
This commit is contained in:
Matthias Bentrup 2015-02-05 09:32:21 +01:00 committed by Nigel Stewart
parent bac20de049
commit 60f39ed9fd
3 changed files with 15 additions and 0 deletions

View File

@ -64,6 +64,8 @@ static GLenum GLEWAPIENTRY glewContextInit ()
const GLubyte* s;
GLuint dot;
GLint major, minor;
GLint context_flags = 0;
GLint context_profile = GL_CONTEXT_COMPATIBILITY_PROFILE_BIT;
/* query opengl version */
s = glGetString(GL_VERSION);
@ -169,3 +171,12 @@ static GLenum GLEWAPIENTRY glewContextInit ()
free(begin);
}
}
if( GLEW_VERSION_3_0 )
glGetIntegerv(GL_CONTEXT_FLAGS, &context_flags);
if( GLEW_VERSION_3_2 )
glGetIntegerv(GL_CONTEXT_PROFILE_MASK, &context_profile);
else if( GLEW_VERSION_3_1 && !glewGetExtension("GL_ARB_compatibility"))
context_profile = GL_CONTEXT_CORE_PROFILE_BIT;
/* initialize core functions */

View File

@ -17,6 +17,8 @@ GLenum glxewInit ()
int major, minor;
const GLubyte* extStart;
const GLubyte* extEnd;
GLint context_profile = 0, context_flags = 0;
/* initialize core GLX 1.2 */
if (_glewInit_GLX_VERSION_1_2()) return GLEW_ERROR_GLX_VERSION_11_ONLY;
/* initialize flags */

View File

@ -25,6 +25,8 @@ GLenum GLEWAPIENTRY wglewInit ()
GLboolean crippled;
const GLubyte* extStart;
const GLubyte* extEnd;
GLint context_profile = 0, context_flags = 0;
/* find wgl extension string query functions */
_wglewGetExtensionsStringARB = (PFNWGLGETEXTENSIONSSTRINGARBPROC)glewGetProcAddress((const GLubyte*)"wglGetExtensionsStringARB");
_wglewGetExtensionsStringEXT = (PFNWGLGETEXTENSIONSSTRINGEXTPROC)glewGetProcAddress((const GLubyte*)"wglGetExtensionsStringEXT");