From: Diederick Niehorster Date: Mon, 19 Mar 2012 00:31:00 +0000 (+0000) Subject: simplified check for whether opengl 2.1+ context is requested. X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=commitdiff_plain;h=c0a9c566efc4ca3c4ea170f9b538c6c16cb481ed;p=freeglut simplified check for whether opengl 2.1+ context is requested. Flags or profile set are now ignored unless opengl 2.1+ context is requested git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@1198 7f0cb862-5218-0410-a997-914c9d46530a --- diff --git a/src/fg_internal.h b/src/fg_internal.h index 809679f..7e0f30c 100644 --- a/src/fg_internal.h +++ b/src/fg_internal.h @@ -956,7 +956,6 @@ SFG_Proc fgPlatformGetProcAddress( const char *procName ); #define ATTRIB(a) attributes[where++]=(a) #define ATTRIB_VAL(a,v) {ATTRIB(a); ATTRIB(v);} -int fghIsLegacyContextVersionRequested( void ); int fghMapBit( int mask, int from, int to ); int fghIsLegacyContextRequested( void ); void fghContextCreationError( void ); diff --git a/src/fg_window.c b/src/fg_window.c index e7f9275..06efa03 100644 --- a/src/fg_window.c +++ b/src/fg_window.c @@ -70,16 +70,9 @@ extern void fgPlatformGlutFullScreenToggle( SFG_Window *win ); /* -- PRIVATE FUNCTIONS ---------------------------------------------------- */ -int fghIsLegacyContextVersionRequested( void ) -{ - return fgState.MajorVersion < 2 || (fgState.MajorVersion == 2 && fgState.MinorVersion <= 1); -} - int fghIsLegacyContextRequested( void ) { - return fghIsLegacyContextVersionRequested() && - fgState.ContextFlags == 0 && - fgState.ContextProfile == 0; + return fgState.MajorVersion < 2 || (fgState.MajorVersion == 2 && fgState.MinorVersion <= 1); } int fghNumberOfAuxBuffersRequested( void ) diff --git a/src/mswin/fg_window_mswin.c b/src/mswin/fg_window_mswin.c index ae5dad7..0698349 100644 --- a/src/mswin/fg_window_mswin.c +++ b/src/mswin/fg_window_mswin.c @@ -113,10 +113,8 @@ static wchar_t* fghWstrFromStr(const char* str) static void fghFillContextAttributes( int *attributes ) { int where = 0, contextFlags, contextProfile; - if ( !fghIsLegacyContextVersionRequested() ) { - ATTRIB_VAL( WGL_CONTEXT_MAJOR_VERSION_ARB, fgState.MajorVersion ); - ATTRIB_VAL( WGL_CONTEXT_MINOR_VERSION_ARB, fgState.MinorVersion ); - } + ATTRIB_VAL( WGL_CONTEXT_MAJOR_VERSION_ARB, fgState.MajorVersion ); + ATTRIB_VAL( WGL_CONTEXT_MINOR_VERSION_ARB, fgState.MinorVersion ); contextFlags = fghMapBit( fgState.ContextFlags, GLUT_DEBUG, WGL_CONTEXT_DEBUG_BIT_ARB ) | diff --git a/src/x11/fg_window_x11_glx.c b/src/x11/fg_window_x11_glx.c index 316c74e..2efe7e8 100644 --- a/src/x11/fg_window_x11_glx.c +++ b/src/x11/fg_window_x11_glx.c @@ -177,10 +177,8 @@ int fghChooseConfig(GLXFBConfig* fbconfig) static void fghFillContextAttributes( int *attributes ) { int where = 0, contextFlags, contextProfile; - if ( !fghIsLegacyContextVersionRequested() ) { - ATTRIB_VAL( GLX_CONTEXT_MAJOR_VERSION_ARB, fgState.MajorVersion ); - ATTRIB_VAL( GLX_CONTEXT_MINOR_VERSION_ARB, fgState.MinorVersion ); - } + ATTRIB_VAL( GLX_CONTEXT_MAJOR_VERSION_ARB, fgState.MajorVersion ); + ATTRIB_VAL( GLX_CONTEXT_MINOR_VERSION_ARB, fgState.MinorVersion ); contextFlags = fghMapBit( fgState.ContextFlags, GLUT_DEBUG, GLX_CONTEXT_DEBUG_BIT_ARB ) |