mirror of
https://github.com/nigels-com/glew.git
synced 2024-11-28 00:31:56 +00:00
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:
parent
bac20de049
commit
60f39ed9fd
@ -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 */
|
||||
|
@ -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 */
|
||||
|
@ -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");
|
||||
|
Loading…
Reference in New Issue
Block a user