X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=src%2Ffg_state.c;h=580ff10f377fd4e5f4b876293c2e4f7b92fad58b;hb=6636a18df676a102cee0bcf31ce81b67dc7b7ac2;hp=5f8c08afc6e304b0fd644c09d0f0638de16191f9;hpb=0ac0b78d1b1a3d553f1b516b1e63fb738e8c13bc;p=freeglut diff --git a/src/fg_state.c b/src/fg_state.c index 5f8c08a..580ff10 100644 --- a/src/fg_state.c +++ b/src/fg_state.c @@ -44,6 +44,7 @@ extern int fgPlatformGlutGet ( GLenum eWhat ); extern int fgPlatformGlutDeviceGet ( GLenum eWhat ); extern int *fgPlatformGlutGetModeValues(GLenum eWhat, int *size); +extern SFG_Font* fghFontByID( void* font ); /* -- LOCAL DEFINITIONS ---------------------------------------------------- */ @@ -60,9 +61,6 @@ void FGAPIENTRY glutSetOption( GLenum eWhat, int value ) { FREEGLUT_EXIT_IF_NOT_INITIALISED ( "glutSetOption" ); - /* - * XXX In chronological code add order. (WHY in that order?) - */ switch( eWhat ) { case GLUT_INIT_WINDOW_X: @@ -136,13 +134,18 @@ int FGAPIENTRY glutGet( GLenum eWhat ) case GLUT_INIT_STATE: return fgState.Initialised; + /* Although internally the time store is 64bits wide, the return value + * here still wraps every 49.7 days. Integer overflows cancel however + * when subtracting an initial start time, unless the total time exceeds + * 32-bit, so you can still work with this. + * XXX: a glutGet64 to return the time might be an idea... + */ case GLUT_ELAPSED_TIME: return (int) fgElapsedTime(); } FREEGLUT_EXIT_IF_NOT_INITIALISED ( "glutGet" ); - /* XXX In chronological code add order. (WHY in that order?) */ switch( eWhat ) { /* Following values are stored in fgState and fgDisplay global structures */