Numerous style normalizations from John:
* Convert "return( value );" to "return value;" * Normalize spacing around semicolons. * Remove extraneous parens. * Split multi-statement lines into multiple lines. (Mostly things of the form: "if( condition ) return;".) git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@361 7f0cb862-5218-0410-a997-914c9d46530a
This commit is contained in:
parent
7e7ff3191d
commit
354569a7c4
@ -62,18 +62,21 @@ extern SFG_StrokeFont fgStrokeMonoRoman;
|
|||||||
*/
|
*/
|
||||||
static SFG_Font* fghFontByID( void* font )
|
static SFG_Font* fghFontByID( void* font )
|
||||||
{
|
{
|
||||||
/*
|
if( font == GLUT_BITMAP_8_BY_13 )
|
||||||
* XXX Use a macro, a table of some kind, or else split these
|
return &fgFontFixed8x13;
|
||||||
* XXX statements properly. Jamming "return" on the end of an
|
if( font == GLUT_BITMAP_9_BY_15 )
|
||||||
* XXX "if" is just bad style, IMHO.
|
return &fgFontFixed9x15;
|
||||||
*/
|
if( font == GLUT_BITMAP_HELVETICA_10 )
|
||||||
if( font == GLUT_BITMAP_8_BY_13 ) return &fgFontFixed8x13;
|
return &fgFontHelvetica10;
|
||||||
if( font == GLUT_BITMAP_9_BY_15 ) return &fgFontFixed9x15;
|
if( font == GLUT_BITMAP_HELVETICA_12 )
|
||||||
if( font == GLUT_BITMAP_HELVETICA_10 ) return &fgFontHelvetica10;
|
return &fgFontHelvetica12;
|
||||||
if( font == GLUT_BITMAP_HELVETICA_12 ) return &fgFontHelvetica12;
|
if( font == GLUT_BITMAP_HELVETICA_18 )
|
||||||
if( font == GLUT_BITMAP_HELVETICA_18 ) return &fgFontHelvetica18;
|
return &fgFontHelvetica18;
|
||||||
if( font == GLUT_BITMAP_TIMES_ROMAN_10 ) return &fgFontTimesRoman10;
|
if( font == GLUT_BITMAP_TIMES_ROMAN_10 )
|
||||||
if( font == GLUT_BITMAP_TIMES_ROMAN_24 ) return &fgFontTimesRoman24;
|
return &fgFontTimesRoman10;
|
||||||
|
if( font == GLUT_BITMAP_TIMES_ROMAN_24 )
|
||||||
|
return &fgFontTimesRoman24;
|
||||||
|
|
||||||
fgError( "font 0x%08x not found", font );
|
fgError( "font 0x%08x not found", font );
|
||||||
return 0; /*** NOT REACHED ***/
|
return 0; /*** NOT REACHED ***/
|
||||||
}
|
}
|
||||||
@ -84,12 +87,11 @@ static SFG_Font* fghFontByID( void* font )
|
|||||||
*/
|
*/
|
||||||
static SFG_StrokeFont* fghStrokeByID( void* font )
|
static SFG_StrokeFont* fghStrokeByID( void* font )
|
||||||
{
|
{
|
||||||
/*
|
if( font == GLUT_STROKE_ROMAN )
|
||||||
* XXX Same comment as above about jamming "return" in after an
|
return &fgStrokeRoman;
|
||||||
* XXX "if".
|
if( font == GLUT_STROKE_MONO_ROMAN )
|
||||||
*/
|
return &fgStrokeMonoRoman;
|
||||||
if( font == GLUT_STROKE_ROMAN ) return &fgStrokeRoman;
|
|
||||||
if( font == GLUT_STROKE_MONO_ROMAN ) return &fgStrokeMonoRoman;
|
|
||||||
fgError( "stroke font 0x%08x not found", font );
|
fgError( "stroke font 0x%08x not found", font );
|
||||||
return 0; /*** NOT REACHED ***/
|
return 0; /*** NOT REACHED ***/
|
||||||
}
|
}
|
||||||
|
@ -230,7 +230,7 @@ void fgDeinitialize( void )
|
|||||||
|
|
||||||
fgDestroyStructure( );
|
fgDestroyStructure( );
|
||||||
|
|
||||||
while( (timer = ( SFG_Timer * )fgState.Timers.First) )
|
while( timer = ( SFG_Timer * )fgState.Timers.First )
|
||||||
{
|
{
|
||||||
fgListRemove ( &fgState.Timers, &timer->Node );
|
fgListRemove ( &fgState.Timers, &timer->Node );
|
||||||
free( timer );
|
free( timer );
|
||||||
@ -376,9 +376,9 @@ ReadInteger(char *string, char **NextString)
|
|||||||
}
|
}
|
||||||
*NextString = string;
|
*NextString = string;
|
||||||
if (Sign >= 0)
|
if (Sign >= 0)
|
||||||
return (Result);
|
return Result;
|
||||||
else
|
else
|
||||||
return (-Result);
|
return -Result;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int XParseGeometry (
|
static int XParseGeometry (
|
||||||
@ -394,7 +394,8 @@ static int XParseGeometry (
|
|||||||
int tempX = 0, tempY = 0;
|
int tempX = 0, tempY = 0;
|
||||||
char *nextCharacter;
|
char *nextCharacter;
|
||||||
|
|
||||||
if ( (string == NULL) || (*string == '\0')) return(mask);
|
if ( (string == NULL) || (*string == '\0'))
|
||||||
|
return mask;
|
||||||
if (*string == '=')
|
if (*string == '=')
|
||||||
string++; /* ignore possible '=' at beg of geometry spec */
|
string++; /* ignore possible '=' at beg of geometry spec */
|
||||||
|
|
||||||
@ -402,7 +403,7 @@ static int XParseGeometry (
|
|||||||
if (*strind != '+' && *strind != '-' && *strind != 'x') {
|
if (*strind != '+' && *strind != '-' && *strind != 'x') {
|
||||||
tempWidth = ReadInteger(strind, &nextCharacter);
|
tempWidth = ReadInteger(strind, &nextCharacter);
|
||||||
if (strind == nextCharacter)
|
if (strind == nextCharacter)
|
||||||
return (0);
|
return 0;
|
||||||
strind = nextCharacter;
|
strind = nextCharacter;
|
||||||
mask |= WidthValue;
|
mask |= WidthValue;
|
||||||
}
|
}
|
||||||
@ -411,7 +412,7 @@ static int XParseGeometry (
|
|||||||
strind++;
|
strind++;
|
||||||
tempHeight = ReadInteger(strind, &nextCharacter);
|
tempHeight = ReadInteger(strind, &nextCharacter);
|
||||||
if (strind == nextCharacter)
|
if (strind == nextCharacter)
|
||||||
return (0);
|
return 0;
|
||||||
strind = nextCharacter;
|
strind = nextCharacter;
|
||||||
mask |= HeightValue;
|
mask |= HeightValue;
|
||||||
}
|
}
|
||||||
@ -421,7 +422,7 @@ static int XParseGeometry (
|
|||||||
strind++;
|
strind++;
|
||||||
tempX = -ReadInteger(strind, &nextCharacter);
|
tempX = -ReadInteger(strind, &nextCharacter);
|
||||||
if (strind == nextCharacter)
|
if (strind == nextCharacter)
|
||||||
return (0);
|
return 0;
|
||||||
strind = nextCharacter;
|
strind = nextCharacter;
|
||||||
mask |= XNegative;
|
mask |= XNegative;
|
||||||
}
|
}
|
||||||
@ -430,7 +431,7 @@ static int XParseGeometry (
|
|||||||
strind++;
|
strind++;
|
||||||
tempX = ReadInteger(strind, &nextCharacter);
|
tempX = ReadInteger(strind, &nextCharacter);
|
||||||
if (strind == nextCharacter)
|
if (strind == nextCharacter)
|
||||||
return(0);
|
return 0;
|
||||||
strind = nextCharacter;
|
strind = nextCharacter;
|
||||||
}
|
}
|
||||||
mask |= XValue;
|
mask |= XValue;
|
||||||
@ -439,7 +440,7 @@ static int XParseGeometry (
|
|||||||
strind++;
|
strind++;
|
||||||
tempY = -ReadInteger(strind, &nextCharacter);
|
tempY = -ReadInteger(strind, &nextCharacter);
|
||||||
if (strind == nextCharacter)
|
if (strind == nextCharacter)
|
||||||
return(0);
|
return 0;
|
||||||
strind = nextCharacter;
|
strind = nextCharacter;
|
||||||
mask |= YNegative;
|
mask |= YNegative;
|
||||||
}
|
}
|
||||||
@ -448,7 +449,7 @@ static int XParseGeometry (
|
|||||||
strind++;
|
strind++;
|
||||||
tempY = ReadInteger(strind, &nextCharacter);
|
tempY = ReadInteger(strind, &nextCharacter);
|
||||||
if (strind == nextCharacter)
|
if (strind == nextCharacter)
|
||||||
return(0);
|
return 0;
|
||||||
strind = nextCharacter;
|
strind = nextCharacter;
|
||||||
}
|
}
|
||||||
mask |= YValue;
|
mask |= YValue;
|
||||||
@ -458,7 +459,7 @@ static int XParseGeometry (
|
|||||||
/* If strind isn't at the end of the string the it's an invalid
|
/* If strind isn't at the end of the string the it's an invalid
|
||||||
geometry specification. */
|
geometry specification. */
|
||||||
|
|
||||||
if (*strind != '\0') return (0);
|
if (*strind != '\0') return 0;
|
||||||
|
|
||||||
if (mask & XValue)
|
if (mask & XValue)
|
||||||
*x = tempX;
|
*x = tempX;
|
||||||
@ -468,7 +469,7 @@ static int XParseGeometry (
|
|||||||
*width = tempWidth;
|
*width = tempWidth;
|
||||||
if (mask & HeightValue)
|
if (mask & HeightValue)
|
||||||
*height = tempHeight;
|
*height = tempHeight;
|
||||||
return (mask);
|
return mask;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -132,10 +132,10 @@ int FGAPIENTRY glutGet( GLenum eWhat )
|
|||||||
switch (eWhat)
|
switch (eWhat)
|
||||||
{
|
{
|
||||||
case GLUT_INIT_STATE:
|
case GLUT_INIT_STATE:
|
||||||
return ( fgState.Initialised ) ;
|
return fgState.Initialised;
|
||||||
|
|
||||||
case GLUT_ELAPSED_TIME:
|
case GLUT_ELAPSED_TIME:
|
||||||
return( fgElapsedTime() );
|
return fgElapsedTime();
|
||||||
}
|
}
|
||||||
|
|
||||||
freeglut_assert_ready;
|
freeglut_assert_ready;
|
||||||
@ -148,15 +148,15 @@ int FGAPIENTRY glutGet( GLenum eWhat )
|
|||||||
/*
|
/*
|
||||||
* Following values are stored in fgState and fgDisplay global structures
|
* Following values are stored in fgState and fgDisplay global structures
|
||||||
*/
|
*/
|
||||||
case GLUT_SCREEN_WIDTH: return( fgDisplay.ScreenWidth );
|
case GLUT_SCREEN_WIDTH: return fgDisplay.ScreenWidth ;
|
||||||
case GLUT_SCREEN_HEIGHT: return( fgDisplay.ScreenHeight );
|
case GLUT_SCREEN_HEIGHT: return fgDisplay.ScreenHeight ;
|
||||||
case GLUT_SCREEN_WIDTH_MM: return( fgDisplay.ScreenWidthMM );
|
case GLUT_SCREEN_WIDTH_MM: return fgDisplay.ScreenWidthMM ;
|
||||||
case GLUT_SCREEN_HEIGHT_MM: return( fgDisplay.ScreenHeightMM );
|
case GLUT_SCREEN_HEIGHT_MM: return fgDisplay.ScreenHeightMM;
|
||||||
case GLUT_INIT_WINDOW_X: return( fgState.Position.X );
|
case GLUT_INIT_WINDOW_X: return fgState.Position.X ;
|
||||||
case GLUT_INIT_WINDOW_Y: return( fgState.Position.Y );
|
case GLUT_INIT_WINDOW_Y: return fgState.Position.Y ;
|
||||||
case GLUT_INIT_WINDOW_WIDTH: return( fgState.Size.X );
|
case GLUT_INIT_WINDOW_WIDTH: return fgState.Size.X ;
|
||||||
case GLUT_INIT_WINDOW_HEIGHT: return( fgState.Size.Y );
|
case GLUT_INIT_WINDOW_HEIGHT: return fgState.Size.Y ;
|
||||||
case GLUT_INIT_DISPLAY_MODE: return( fgState.DisplayMode );
|
case GLUT_INIT_DISPLAY_MODE: return fgState.DisplayMode ;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The window/context specific queries are handled mostly by
|
* The window/context specific queries are handled mostly by
|
||||||
@ -166,14 +166,14 @@ int FGAPIENTRY glutGet( GLenum eWhat )
|
|||||||
/*
|
/*
|
||||||
* XXX Multisampling. Return what I know about multisampling.
|
* XXX Multisampling. Return what I know about multisampling.
|
||||||
*/
|
*/
|
||||||
return( 0 );
|
return 0;
|
||||||
|
|
||||||
#if TARGET_HOST_UNIX_X11
|
#if TARGET_HOST_UNIX_X11
|
||||||
/*
|
/*
|
||||||
* The rest of GLX queries under X are general enough to use a macro to
|
* The rest of GLX queries under X are general enough to use a macro to
|
||||||
* check them
|
* check them
|
||||||
*/
|
*/
|
||||||
# define GLX_QUERY(a,b) case a: return( fghGetConfig( b ) );
|
# define GLX_QUERY(a,b) case a: return fghGetConfig( b );
|
||||||
|
|
||||||
GLX_QUERY( GLUT_WINDOW_RGBA, GLX_RGBA );
|
GLX_QUERY( GLUT_WINDOW_RGBA, GLX_RGBA );
|
||||||
GLX_QUERY( GLUT_WINDOW_DOUBLEBUFFER, GLX_DOUBLEBUFFER );
|
GLX_QUERY( GLUT_WINDOW_DOUBLEBUFFER, GLX_DOUBLEBUFFER );
|
||||||
@ -202,9 +202,9 @@ int FGAPIENTRY glutGet( GLenum eWhat )
|
|||||||
* We've got a RGBA visual, so there is no colormap at all.
|
* We've got a RGBA visual, so there is no colormap at all.
|
||||||
* The other possibility is that we have no current window set.
|
* The other possibility is that we have no current window set.
|
||||||
*/
|
*/
|
||||||
return( 0 );
|
return 0;
|
||||||
}
|
}
|
||||||
return( fgStructure.Window->Window.VisualInfo->visual->map_entries );
|
return fgStructure.Window->Window.VisualInfo->visual->map_entries;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Those calls are somewhat similiar, as they use XGetWindowAttributes()
|
* Those calls are somewhat similiar, as they use XGetWindowAttributes()
|
||||||
@ -219,7 +219,7 @@ int FGAPIENTRY glutGet( GLenum eWhat )
|
|||||||
Window w;
|
Window w;
|
||||||
|
|
||||||
if( fgStructure.Window == NULL )
|
if( fgStructure.Window == NULL )
|
||||||
return( 0 );
|
return 0;
|
||||||
|
|
||||||
XTranslateCoordinates(
|
XTranslateCoordinates(
|
||||||
fgDisplay.Display,
|
fgDisplay.Display,
|
||||||
@ -234,7 +234,7 @@ int FGAPIENTRY glutGet( GLenum eWhat )
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ( w == 0 )
|
if ( w == 0 )
|
||||||
return( 0 );
|
return 0;
|
||||||
XTranslateCoordinates(
|
XTranslateCoordinates(
|
||||||
fgDisplay.Display,
|
fgDisplay.Display,
|
||||||
fgStructure.Window->Window.Handle,
|
fgStructure.Window->Window.Handle,
|
||||||
@ -253,7 +253,7 @@ int FGAPIENTRY glutGet( GLenum eWhat )
|
|||||||
XWindowAttributes winAttributes;
|
XWindowAttributes winAttributes;
|
||||||
|
|
||||||
if( fgStructure.Window == NULL )
|
if( fgStructure.Window == NULL )
|
||||||
return( 0 );
|
return 0;
|
||||||
XGetWindowAttributes(
|
XGetWindowAttributes(
|
||||||
fgDisplay.Display,
|
fgDisplay.Display,
|
||||||
fgStructure.Window->Window.Handle,
|
fgStructure.Window->Window.Handle,
|
||||||
@ -277,9 +277,9 @@ int FGAPIENTRY glutGet( GLenum eWhat )
|
|||||||
*/
|
*/
|
||||||
case GLUT_WINDOW_FORMAT_ID:
|
case GLUT_WINDOW_FORMAT_ID:
|
||||||
if( fgStructure.Window == NULL )
|
if( fgStructure.Window == NULL )
|
||||||
return( 0 );
|
return 0;
|
||||||
|
|
||||||
return( fgStructure.Window->Window.VisualInfo->visualid );
|
return fgStructure.Window->Window.VisualInfo->visualid;
|
||||||
|
|
||||||
#elif TARGET_HOST_WIN32
|
#elif TARGET_HOST_WIN32
|
||||||
|
|
||||||
@ -289,50 +289,50 @@ int FGAPIENTRY glutGet( GLenum eWhat )
|
|||||||
case GLUT_WINDOW_RGBA:
|
case GLUT_WINDOW_RGBA:
|
||||||
glGetBooleanv ( GL_RGBA_MODE, &boolValue );
|
glGetBooleanv ( GL_RGBA_MODE, &boolValue );
|
||||||
returnValue = boolValue ? 1 : 0;
|
returnValue = boolValue ? 1 : 0;
|
||||||
return ( returnValue ) ;
|
return returnValue;
|
||||||
case GLUT_WINDOW_DOUBLEBUFFER:
|
case GLUT_WINDOW_DOUBLEBUFFER:
|
||||||
glGetBooleanv ( GL_DOUBLEBUFFER, &boolValue );
|
glGetBooleanv ( GL_DOUBLEBUFFER, &boolValue );
|
||||||
returnValue = boolValue ? 1 : 0;
|
returnValue = boolValue ? 1 : 0;
|
||||||
return ( returnValue ) ;
|
return returnValue;
|
||||||
case GLUT_WINDOW_STEREO:
|
case GLUT_WINDOW_STEREO:
|
||||||
glGetBooleanv ( GL_STEREO, &boolValue );
|
glGetBooleanv ( GL_STEREO, &boolValue );
|
||||||
returnValue = boolValue ? 1 : 0;
|
returnValue = boolValue ? 1 : 0;
|
||||||
return ( returnValue ) ;
|
return returnValue;
|
||||||
|
|
||||||
case GLUT_WINDOW_RED_SIZE:
|
case GLUT_WINDOW_RED_SIZE:
|
||||||
glGetIntegerv ( GL_RED_BITS, &returnValue );
|
glGetIntegerv ( GL_RED_BITS, &returnValue );
|
||||||
return ( returnValue ) ;
|
return returnValue;
|
||||||
case GLUT_WINDOW_GREEN_SIZE:
|
case GLUT_WINDOW_GREEN_SIZE:
|
||||||
glGetIntegerv ( GL_GREEN_BITS, &returnValue );
|
glGetIntegerv ( GL_GREEN_BITS, &returnValue );
|
||||||
return ( returnValue ) ;
|
return returnValue;
|
||||||
case GLUT_WINDOW_BLUE_SIZE:
|
case GLUT_WINDOW_BLUE_SIZE:
|
||||||
glGetIntegerv ( GL_BLUE_BITS, &returnValue );
|
glGetIntegerv ( GL_BLUE_BITS, &returnValue );
|
||||||
return ( returnValue ) ;
|
return returnValue;
|
||||||
case GLUT_WINDOW_ALPHA_SIZE:
|
case GLUT_WINDOW_ALPHA_SIZE:
|
||||||
glGetIntegerv ( GL_ALPHA_BITS, &returnValue );
|
glGetIntegerv ( GL_ALPHA_BITS, &returnValue );
|
||||||
return ( returnValue ) ;
|
return returnValue;
|
||||||
case GLUT_WINDOW_ACCUM_RED_SIZE:
|
case GLUT_WINDOW_ACCUM_RED_SIZE:
|
||||||
glGetIntegerv ( GL_ACCUM_RED_BITS, &returnValue );
|
glGetIntegerv ( GL_ACCUM_RED_BITS, &returnValue );
|
||||||
return ( returnValue ) ;
|
return returnValue;
|
||||||
case GLUT_WINDOW_ACCUM_GREEN_SIZE:
|
case GLUT_WINDOW_ACCUM_GREEN_SIZE:
|
||||||
glGetIntegerv ( GL_ACCUM_GREEN_BITS, &returnValue );
|
glGetIntegerv ( GL_ACCUM_GREEN_BITS, &returnValue );
|
||||||
return ( returnValue ) ;
|
return returnValue;
|
||||||
case GLUT_WINDOW_ACCUM_BLUE_SIZE:
|
case GLUT_WINDOW_ACCUM_BLUE_SIZE:
|
||||||
glGetIntegerv ( GL_ACCUM_BLUE_BITS, &returnValue );
|
glGetIntegerv ( GL_ACCUM_BLUE_BITS, &returnValue );
|
||||||
return ( returnValue ) ;
|
return returnValue;
|
||||||
case GLUT_WINDOW_ACCUM_ALPHA_SIZE:
|
case GLUT_WINDOW_ACCUM_ALPHA_SIZE:
|
||||||
glGetIntegerv ( GL_ACCUM_ALPHA_BITS, &returnValue );
|
glGetIntegerv ( GL_ACCUM_ALPHA_BITS, &returnValue );
|
||||||
return ( returnValue ) ;
|
return returnValue;
|
||||||
case GLUT_WINDOW_DEPTH_SIZE:
|
case GLUT_WINDOW_DEPTH_SIZE:
|
||||||
glGetIntegerv ( GL_DEPTH_BITS, &returnValue );
|
glGetIntegerv ( GL_DEPTH_BITS, &returnValue );
|
||||||
return ( returnValue ) ;
|
return returnValue;
|
||||||
|
|
||||||
case GLUT_WINDOW_BUFFER_SIZE:
|
case GLUT_WINDOW_BUFFER_SIZE:
|
||||||
returnValue = 1 ; /* ????? */
|
returnValue = 1 ; /* ????? */
|
||||||
return ( returnValue ) ;
|
return returnValue;
|
||||||
case GLUT_WINDOW_STENCIL_SIZE:
|
case GLUT_WINDOW_STENCIL_SIZE:
|
||||||
returnValue = 0 ; /* ????? */
|
returnValue = 0 ; /* ????? */
|
||||||
return ( returnValue ) ;
|
return returnValue;
|
||||||
|
|
||||||
case GLUT_WINDOW_X:
|
case GLUT_WINDOW_X:
|
||||||
case GLUT_WINDOW_Y:
|
case GLUT_WINDOW_Y:
|
||||||
@ -387,28 +387,28 @@ int FGAPIENTRY glutGet( GLenum eWhat )
|
|||||||
|
|
||||||
switch( eWhat )
|
switch( eWhat )
|
||||||
{
|
{
|
||||||
case GLUT_WINDOW_X: return( winRect.left );
|
case GLUT_WINDOW_X: return winRect.left ;
|
||||||
case GLUT_WINDOW_Y: return( winRect.top );
|
case GLUT_WINDOW_Y: return winRect.top ;
|
||||||
case GLUT_WINDOW_WIDTH: return( winRect.right - winRect.left );
|
case GLUT_WINDOW_WIDTH: return winRect.right - winRect.left;
|
||||||
case GLUT_WINDOW_HEIGHT: return( winRect.bottom - winRect.top );
|
case GLUT_WINDOW_HEIGHT: return winRect.bottom - winRect.top;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case GLUT_WINDOW_BORDER_WIDTH :
|
case GLUT_WINDOW_BORDER_WIDTH :
|
||||||
return ( GetSystemMetrics( SM_CXSIZEFRAME ) ) ;
|
return GetSystemMetrics( SM_CXSIZEFRAME );
|
||||||
|
|
||||||
case GLUT_WINDOW_HEADER_HEIGHT :
|
case GLUT_WINDOW_HEADER_HEIGHT :
|
||||||
return ( GetSystemMetrics( SM_CYCAPTION ) ) ;
|
return GetSystemMetrics( SM_CYCAPTION );
|
||||||
|
|
||||||
case GLUT_DISPLAY_MODE_POSSIBLE:
|
case GLUT_DISPLAY_MODE_POSSIBLE:
|
||||||
return( fgSetupPixelFormat( fgStructure.Window, GL_TRUE,
|
return fgSetupPixelFormat( fgStructure.Window, GL_TRUE,
|
||||||
PFD_MAIN_PLANE ) );
|
PFD_MAIN_PLANE );
|
||||||
|
|
||||||
case GLUT_WINDOW_FORMAT_ID:
|
case GLUT_WINDOW_FORMAT_ID:
|
||||||
if( fgStructure.Window != NULL )
|
if( fgStructure.Window != NULL )
|
||||||
return( GetPixelFormat( fgStructure.Window->Window.Device ) );
|
return GetPixelFormat( fgStructure.Window->Window.Device );
|
||||||
return( 0 );
|
return 0;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -416,24 +416,24 @@ int FGAPIENTRY glutGet( GLenum eWhat )
|
|||||||
* The window structure queries
|
* The window structure queries
|
||||||
*/
|
*/
|
||||||
case GLUT_WINDOW_PARENT:
|
case GLUT_WINDOW_PARENT:
|
||||||
if( fgStructure.Window == NULL ) return( 0 );
|
if( fgStructure.Window == NULL ) return 0;
|
||||||
if( fgStructure.Window->Parent == NULL ) return( 0 );
|
if( fgStructure.Window->Parent == NULL ) return 0;
|
||||||
return( fgStructure.Window->Parent->ID );
|
return fgStructure.Window->Parent->ID;
|
||||||
|
|
||||||
case GLUT_WINDOW_NUM_CHILDREN:
|
case GLUT_WINDOW_NUM_CHILDREN:
|
||||||
if( fgStructure.Window == NULL )
|
if( fgStructure.Window == NULL )
|
||||||
return( 0 );
|
return 0;
|
||||||
return( fgListLength( &fgStructure.Window->Children ) );
|
return fgListLength( &fgStructure.Window->Children );
|
||||||
|
|
||||||
case GLUT_WINDOW_CURSOR:
|
case GLUT_WINDOW_CURSOR:
|
||||||
if( fgStructure.Window == NULL )
|
if( fgStructure.Window == NULL )
|
||||||
return( 0 );
|
return 0;
|
||||||
return( fgStructure.Window->State.Cursor );
|
return fgStructure.Window->State.Cursor;
|
||||||
|
|
||||||
case GLUT_MENU_NUM_ITEMS:
|
case GLUT_MENU_NUM_ITEMS:
|
||||||
if( fgStructure.Menu == NULL )
|
if( fgStructure.Menu == NULL )
|
||||||
return( 0 );
|
return 0;
|
||||||
return( fgListLength( &fgStructure.Menu->Entries ) );
|
return fgListLength( &fgStructure.Menu->Entries );
|
||||||
|
|
||||||
case GLUT_ACTION_ON_WINDOW_CLOSE:
|
case GLUT_ACTION_ON_WINDOW_CLOSE:
|
||||||
return fgState.ActionOnWindowClose;
|
return fgState.ActionOnWindowClose;
|
||||||
@ -442,13 +442,14 @@ int FGAPIENTRY glutGet( GLenum eWhat )
|
|||||||
return VERSION_MAJOR * 10000 + VERSION_MINOR * 100 + VERSION_PATCH;
|
return VERSION_MAJOR * 10000 + VERSION_MINOR * 100 + VERSION_PATCH;
|
||||||
|
|
||||||
case GLUT_RENDERING_CONTEXT:
|
case GLUT_RENDERING_CONTEXT:
|
||||||
return ( fgState.UseCurrentContext ? GLUT_USE_CURRENT_CONTEXT : GLUT_CREATE_NEW_CONTEXT ) ;
|
return fgState.UseCurrentContext ? GLUT_USE_CURRENT_CONTEXT
|
||||||
|
: GLUT_CREATE_NEW_CONTEXT;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
fgWarning( "glutGet(): missing enum handle %i\n", eWhat );
|
fgWarning( "glutGet(): missing enum handle %i\n", eWhat );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return( -1 );
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -473,12 +474,12 @@ int FGAPIENTRY glutDeviceGet( GLenum eWhat )
|
|||||||
* XXX Though in actuality, we can probably assume BOTH a
|
* XXX Though in actuality, we can probably assume BOTH a
|
||||||
* XXX mouse and keyboard for most/all of our users.
|
* XXX mouse and keyboard for most/all of our users.
|
||||||
*/
|
*/
|
||||||
return( TRUE );
|
return TRUE ;
|
||||||
|
|
||||||
#if TARGET_HOST_UNIX_X11
|
#if TARGET_HOST_UNIX_X11
|
||||||
|
|
||||||
case GLUT_HAS_MOUSE:
|
case GLUT_HAS_MOUSE:
|
||||||
return( TRUE );
|
return TRUE ;
|
||||||
|
|
||||||
case GLUT_NUM_MOUSE_BUTTONS:
|
case GLUT_NUM_MOUSE_BUTTONS:
|
||||||
/*
|
/*
|
||||||
@ -500,7 +501,7 @@ int FGAPIENTRY glutDeviceGet( GLenum eWhat )
|
|||||||
* XXX XFree86...) It is at least worth taking a look at
|
* XXX XFree86...) It is at least worth taking a look at
|
||||||
* XXX this file.
|
* XXX this file.
|
||||||
*/
|
*/
|
||||||
return( 3 );
|
return 3 ;
|
||||||
|
|
||||||
#elif TARGET_HOST_WIN32
|
#elif TARGET_HOST_WIN32
|
||||||
|
|
||||||
@ -509,13 +510,13 @@ int FGAPIENTRY glutDeviceGet( GLenum eWhat )
|
|||||||
* The Windows can be booted without a mouse.
|
* The Windows can be booted without a mouse.
|
||||||
* It would be nice to have this reported.
|
* It would be nice to have this reported.
|
||||||
*/
|
*/
|
||||||
return( GetSystemMetrics( SM_MOUSEPRESENT ) );
|
return GetSystemMetrics( SM_MOUSEPRESENT );
|
||||||
|
|
||||||
case GLUT_NUM_MOUSE_BUTTONS:
|
case GLUT_NUM_MOUSE_BUTTONS:
|
||||||
/*
|
/*
|
||||||
* We are much more fortunate under Win32 about this...
|
* We are much more fortunate under Win32 about this...
|
||||||
*/
|
*/
|
||||||
return( GetSystemMetrics( SM_CMOUSEBUTTONS ) );
|
return GetSystemMetrics( SM_CMOUSEBUTTONS );
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -526,27 +527,27 @@ int FGAPIENTRY glutDeviceGet( GLenum eWhat )
|
|||||||
/*
|
/*
|
||||||
* XXX WARNING: THIS IS A BIG LIE!
|
* XXX WARNING: THIS IS A BIG LIE!
|
||||||
*/
|
*/
|
||||||
return( 0 );
|
return 0;
|
||||||
|
|
||||||
case GLUT_HAS_SPACEBALL:
|
case GLUT_HAS_SPACEBALL:
|
||||||
case GLUT_HAS_DIAL_AND_BUTTON_BOX:
|
case GLUT_HAS_DIAL_AND_BUTTON_BOX:
|
||||||
case GLUT_HAS_TABLET:
|
case GLUT_HAS_TABLET:
|
||||||
return( FALSE );
|
return FALSE;
|
||||||
|
|
||||||
case GLUT_NUM_SPACEBALL_BUTTONS:
|
case GLUT_NUM_SPACEBALL_BUTTONS:
|
||||||
case GLUT_NUM_BUTTON_BOX_BUTTONS:
|
case GLUT_NUM_BUTTON_BOX_BUTTONS:
|
||||||
case GLUT_NUM_DIALS:
|
case GLUT_NUM_DIALS:
|
||||||
case GLUT_NUM_TABLET_BUTTONS:
|
case GLUT_NUM_TABLET_BUTTONS:
|
||||||
return( 0 );
|
return 0;
|
||||||
|
|
||||||
case GLUT_DEVICE_IGNORE_KEY_REPEAT:
|
case GLUT_DEVICE_IGNORE_KEY_REPEAT:
|
||||||
return( fgState.IgnoreKeyRepeat );
|
return fgState.IgnoreKeyRepeat;
|
||||||
|
|
||||||
case GLUT_DEVICE_KEY_REPEAT:
|
case GLUT_DEVICE_KEY_REPEAT:
|
||||||
/*
|
/*
|
||||||
* XXX WARNING: THIS IS A BIG LIE!
|
* XXX WARNING: THIS IS A BIG LIE!
|
||||||
*/
|
*/
|
||||||
return( GLUT_KEY_REPEAT_DEFAULT );
|
return GLUT_KEY_REPEAT_DEFAULT;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
fgWarning( "glutDeviceGet(): missing enum handle %i\n", eWhat );
|
fgWarning( "glutDeviceGet(): missing enum handle %i\n", eWhat );
|
||||||
@ -556,7 +557,7 @@ int FGAPIENTRY glutDeviceGet( GLenum eWhat )
|
|||||||
/*
|
/*
|
||||||
* And now -- the failure.
|
* And now -- the failure.
|
||||||
*/
|
*/
|
||||||
return( -1 );
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -567,10 +568,10 @@ int FGAPIENTRY glutGetModifiers( void )
|
|||||||
if( fgState.Modifiers == 0xffffffff )
|
if( fgState.Modifiers == 0xffffffff )
|
||||||
{
|
{
|
||||||
fgWarning( "glutGetModifiers() called outside an input callback" );
|
fgWarning( "glutGetModifiers() called outside an input callback" );
|
||||||
return( 0 );
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
return( fgState.Modifiers );
|
return fgState.Modifiers;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -592,13 +593,13 @@ int FGAPIENTRY glutLayerGet( GLenum eWhat )
|
|||||||
#if TARGET_HOST_UNIX_X11
|
#if TARGET_HOST_UNIX_X11
|
||||||
|
|
||||||
case GLUT_OVERLAY_POSSIBLE:
|
case GLUT_OVERLAY_POSSIBLE:
|
||||||
return( FALSE );
|
return FALSE;
|
||||||
|
|
||||||
case GLUT_LAYER_IN_USE:
|
case GLUT_LAYER_IN_USE:
|
||||||
return( GLUT_NORMAL );
|
return GLUT_NORMAL;
|
||||||
|
|
||||||
case GLUT_HAS_OVERLAY:
|
case GLUT_HAS_OVERLAY:
|
||||||
return( FALSE );
|
return FALSE;
|
||||||
|
|
||||||
case GLUT_TRANSPARENT_INDEX:
|
case GLUT_TRANSPARENT_INDEX:
|
||||||
/*
|
/*
|
||||||
@ -606,29 +607,29 @@ int FGAPIENTRY glutLayerGet( GLenum eWhat )
|
|||||||
*
|
*
|
||||||
* XXX HUH?
|
* XXX HUH?
|
||||||
*/
|
*/
|
||||||
return( 0 );
|
return 0;
|
||||||
|
|
||||||
case GLUT_NORMAL_DAMAGED:
|
case GLUT_NORMAL_DAMAGED:
|
||||||
/*
|
/*
|
||||||
* XXX Actually I do not know. Maybe.
|
* XXX Actually I do not know. Maybe.
|
||||||
*/
|
*/
|
||||||
return( FALSE );
|
return FALSE;
|
||||||
|
|
||||||
case GLUT_OVERLAY_DAMAGED:
|
case GLUT_OVERLAY_DAMAGED:
|
||||||
return( -1 );
|
return -1;
|
||||||
|
|
||||||
#elif TARGET_HOST_WIN32
|
#elif TARGET_HOST_WIN32
|
||||||
|
|
||||||
case GLUT_OVERLAY_POSSIBLE:
|
case GLUT_OVERLAY_POSSIBLE:
|
||||||
/* return( fgSetupPixelFormat( fgStructure.Window, GL_TRUE,
|
/* return fgSetupPixelFormat( fgStructure.Window, GL_TRUE,
|
||||||
PFD_OVERLAY_PLANE ) ); */
|
PFD_OVERLAY_PLANE ); */
|
||||||
return FALSE ;
|
return FALSE ;
|
||||||
|
|
||||||
case GLUT_LAYER_IN_USE:
|
case GLUT_LAYER_IN_USE:
|
||||||
return( GLUT_NORMAL );
|
return GLUT_NORMAL;
|
||||||
|
|
||||||
case GLUT_HAS_OVERLAY:
|
case GLUT_HAS_OVERLAY:
|
||||||
return( FALSE );
|
return FALSE;
|
||||||
|
|
||||||
case GLUT_TRANSPARENT_INDEX:
|
case GLUT_TRANSPARENT_INDEX:
|
||||||
/*
|
/*
|
||||||
@ -636,16 +637,16 @@ int FGAPIENTRY glutLayerGet( GLenum eWhat )
|
|||||||
*
|
*
|
||||||
* XXX HUH?
|
* XXX HUH?
|
||||||
*/
|
*/
|
||||||
return( 0 );
|
return 0;
|
||||||
|
|
||||||
case GLUT_NORMAL_DAMAGED:
|
case GLUT_NORMAL_DAMAGED:
|
||||||
/*
|
/*
|
||||||
* XXX Actually I do not know. Maybe.
|
* XXX Actually I do not know. Maybe.
|
||||||
*/
|
*/
|
||||||
return( FALSE );
|
return FALSE;
|
||||||
|
|
||||||
case GLUT_OVERLAY_DAMAGED:
|
case GLUT_OVERLAY_DAMAGED:
|
||||||
return( -1 );
|
return -1;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
default:
|
default:
|
||||||
@ -656,7 +657,7 @@ int FGAPIENTRY glutLayerGet( GLenum eWhat )
|
|||||||
/*
|
/*
|
||||||
* And fail. That's good. Programs do love failing.
|
* And fail. That's good. Programs do love failing.
|
||||||
*/
|
*/
|
||||||
return( -1 );
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*** END OF FILE ***/
|
/*** END OF FILE ***/
|
||||||
|
@ -279,7 +279,7 @@ void fgDestroyWindow( SFG_Window* window, GLboolean needToClose )
|
|||||||
assert( window );
|
assert( window );
|
||||||
freeglut_assert_ready;
|
freeglut_assert_ready;
|
||||||
|
|
||||||
while( (subWindow = ( SFG_Window * )window->Children.First) )
|
while( subWindow = ( SFG_Window * )window->Children.First )
|
||||||
fgDestroyWindow( subWindow, needToClose );
|
fgDestroyWindow( subWindow, needToClose );
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -402,7 +402,7 @@ void fgDestroyMenu( SFG_Menu* menu )
|
|||||||
* Now we are pretty sure the menu is not used anywhere
|
* Now we are pretty sure the menu is not used anywhere
|
||||||
* and that we can remove all of its entries
|
* and that we can remove all of its entries
|
||||||
*/
|
*/
|
||||||
while( (entry = ( SFG_MenuEntry * )menu->Entries.First) )
|
while( entry = ( SFG_MenuEntry * )menu->Entries.First )
|
||||||
{
|
{
|
||||||
fgListRemove( &menu->Entries, &entry->Node );
|
fgListRemove( &menu->Entries, &entry->Node );
|
||||||
|
|
||||||
@ -457,10 +457,10 @@ void fgDestroyStructure( void )
|
|||||||
/*
|
/*
|
||||||
* Make sure all windows and menus have been deallocated
|
* Make sure all windows and menus have been deallocated
|
||||||
*/
|
*/
|
||||||
while( (menu = ( SFG_Menu * )fgStructure.Menus.First) )
|
while( menu = ( SFG_Menu * )fgStructure.Menus.First )
|
||||||
fgDestroyMenu( menu );
|
fgDestroyMenu( menu );
|
||||||
|
|
||||||
while( (window = ( SFG_Window * )fgStructure.Windows.First) )
|
while( window = ( SFG_Window * )fgStructure.Windows.First )
|
||||||
fgDestroyWindow( window, GL_TRUE );
|
fgDestroyWindow( window, GL_TRUE );
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -651,7 +651,7 @@ void fgListAppend(SFG_List *list, SFG_Node *node)
|
|||||||
{
|
{
|
||||||
SFG_Node *ln;
|
SFG_Node *ln;
|
||||||
|
|
||||||
if ( (ln = (SFG_Node *)list->Last) )
|
if ( ln = (SFG_Node *)list->Last )
|
||||||
{
|
{
|
||||||
ln->Next = node;
|
ln->Next = node;
|
||||||
node->Prev = ln;
|
node->Prev = ln;
|
||||||
@ -670,9 +670,9 @@ void fgListRemove(SFG_List *list, SFG_Node *node)
|
|||||||
{
|
{
|
||||||
SFG_Node *ln;
|
SFG_Node *ln;
|
||||||
|
|
||||||
if( (ln = (SFG_Node *)node->Next) )
|
if( ln = (SFG_Node *)node->Next )
|
||||||
ln->Prev = node->Prev;
|
ln->Prev = node->Prev;
|
||||||
if( (ln = (SFG_Node *)node->Prev) )
|
if( ln = (SFG_Node *)node->Prev )
|
||||||
ln->Next = node->Next;
|
ln->Next = node->Next;
|
||||||
if( (ln = (SFG_Node *)list->First) == node )
|
if( (ln = (SFG_Node *)list->First) == node )
|
||||||
list->First = node->Next;
|
list->First = node->Next;
|
||||||
|
Reference in New Issue
Block a user