X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=src%2Ffreeglut_state.c;h=84b261ec9c185c1d8d531596dd25b18545eb8bc7;hb=a34314d2e789de4c95184d1cc74cb3f01a041b20;hp=cb40f059990609153807e19cf091b50a2fff9eac;hpb=646676b8dbf8ab504ac8a275fe9a63a403a3190b;p=freeglut diff --git a/src/freeglut_state.c b/src/freeglut_state.c index cb40f05..84b261e 100644 --- a/src/freeglut_state.c +++ b/src/freeglut_state.c @@ -104,6 +104,9 @@ void FGAPIENTRY glutSetOption( GLenum eWhat, int value ) case GLUT_ACTION_ON_WINDOW_CLOSE: fgState.ActionOnWindowClose = value ; break ; + case GLUT_RENDERING_CONTEXT: fgState.UseCurrentContext = ( value == GLUT_USE_CURRENT_CONTEXT ) ? TRUE : FALSE ; + break ; + case GLUT_WINDOW_CURSOR: if( fgStructure.Window != NULL ) fgStructure.Window->State.Cursor = value ; break ; @@ -122,11 +125,11 @@ void FGAPIENTRY glutSetOption( GLenum eWhat, int value ) */ int FGAPIENTRY glutGet( GLenum eWhat ) { - int returnValue ; - GLboolean boolValue ; + int returnValue ; + GLboolean boolValue ; - if ( eWhat == GLUT_INIT_STATE ) - return ( fgState.Time.Set ) ; + if ( eWhat == GLUT_INIT_STATE ) + return ( fgState.Time.Set ) ; freeglut_assert_ready; @@ -364,8 +367,7 @@ int FGAPIENTRY glutGet( GLenum eWhat ) /* * ...then we've got to correct the results we've just received... */ - if (fgStructure.GameMode != fgStructure.Window && - fgStructure.Window->Parent == NULL ) + if ( ( fgStructure.GameMode != fgStructure.Window ) && ( fgStructure.Window->Parent == NULL ) ) { winRect.left += GetSystemMetrics( SM_CXSIZEFRAME ); winRect.right -= GetSystemMetrics( SM_CXSIZEFRAME ); @@ -452,10 +454,13 @@ int FGAPIENTRY glutGet( GLenum eWhat ) return( fgListLength( &fgStructure.Menu->Entries ) ); case GLUT_ACTION_ON_WINDOW_CLOSE: - return fgState.ActionOnWindowClose; + return fgState.ActionOnWindowClose ; + + case GLUT_VERSION : + return VERSION_MAJOR * 10000 + VERSION_MINOR * 100 + VERSION_PATCH ; - case GLUT_VERSION: - return VERSION_MAJOR * 10000 + VERSION_MINOR * 100 + VERSION_PATCH; + case GLUT_RENDERING_CONTEXT: + return ( fgState.UseCurrentContext ? GLUT_USE_CURRENT_CONTEXT : GLUT_CREATE_NEW_CONTEXT ) ; default: /*