Replace TRUE with GL_TRUE and FALSE with GL_FALSE where the type is
GLboolean. git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@352 7f0cb862-5218-0410-a997-914c9d46530a
This commit is contained in:
parent
06174f9086
commit
3f70f7bdf2
@ -52,7 +52,7 @@ void FGAPIENTRY glutDisplayFunc( void (* callback)( void ) )
|
|||||||
fgError( "Fatal error in program. NULL display callback not "
|
fgError( "Fatal error in program. NULL display callback not "
|
||||||
"permitted in GLUT 3.0+ or freeglut 2.0.1+\n" );
|
"permitted in GLUT 3.0+ or freeglut 2.0.1+\n" );
|
||||||
SET_CALLBACK( Display );
|
SET_CALLBACK( Display );
|
||||||
fgStructure.Window->State.Redisplay = TRUE;
|
fgStructure.Window->State.Redisplay = GL_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -42,7 +42,7 @@ void FGAPIENTRY glutPostRedisplay( void )
|
|||||||
{
|
{
|
||||||
freeglut_assert_ready;
|
freeglut_assert_ready;
|
||||||
freeglut_assert_window;
|
freeglut_assert_window;
|
||||||
fgStructure.Window->State.Redisplay = TRUE;
|
fgStructure.Window->State.Redisplay = GL_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -93,7 +93,7 @@ void FGAPIENTRY glutPostWindowRedisplay( int windowID )
|
|||||||
freeglut_assert_ready;
|
freeglut_assert_ready;
|
||||||
window = fgWindowByID( windowID );
|
window = fgWindowByID( windowID );
|
||||||
freeglut_return_if_fail( window );
|
freeglut_return_if_fail( window );
|
||||||
window->State.Redisplay = TRUE;
|
window->State.Redisplay = GL_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*** END OF FILE ***/
|
/*** END OF FILE ***/
|
||||||
|
@ -262,7 +262,7 @@ GLboolean fghChangeDisplayMode( GLboolean haveToTest )
|
|||||||
fgState.GameModeRefresh ) )
|
fgState.GameModeRefresh ) )
|
||||||
{
|
{
|
||||||
if( haveToTest )
|
if( haveToTest )
|
||||||
return TRUE;
|
return GL_TRUE;
|
||||||
/*
|
/*
|
||||||
* OKi, this is the display mode we have been looking for...
|
* OKi, this is the display mode we have been looking for...
|
||||||
*/
|
*/
|
||||||
@ -271,7 +271,7 @@ GLboolean fghChangeDisplayMode( GLboolean haveToTest )
|
|||||||
fgDisplay.Screen,
|
fgDisplay.Screen,
|
||||||
displayModes[ i ]
|
displayModes[ i ]
|
||||||
);
|
);
|
||||||
return TRUE;
|
return GL_TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -279,7 +279,7 @@ GLboolean fghChangeDisplayMode( GLboolean haveToTest )
|
|||||||
/*
|
/*
|
||||||
* Something must have went wrong
|
* Something must have went wrong
|
||||||
*/
|
*/
|
||||||
return FALSE;
|
return GL_FALSE;
|
||||||
|
|
||||||
# else
|
# else
|
||||||
# warning fghChangeDisplayMode: missing XFree86 video mode extensions, game mode will not change screen resolution when activated
|
# warning fghChangeDisplayMode: missing XFree86 video mode extensions, game mode will not change screen resolution when activated
|
||||||
@ -288,7 +288,7 @@ GLboolean fghChangeDisplayMode( GLboolean haveToTest )
|
|||||||
#elif TARGET_HOST_WIN32
|
#elif TARGET_HOST_WIN32
|
||||||
|
|
||||||
unsigned int displayModes = 0, mode = 0xffffffff;
|
unsigned int displayModes = 0, mode = 0xffffffff;
|
||||||
GLboolean success = FALSE;
|
GLboolean success = GL_FALSE;
|
||||||
/* HDC desktopDC; */
|
/* HDC desktopDC; */
|
||||||
DEVMODE devMode;
|
DEVMODE devMode;
|
||||||
|
|
||||||
@ -296,7 +296,7 @@ GLboolean fghChangeDisplayMode( GLboolean haveToTest )
|
|||||||
* Enumerate the available display modes
|
* Enumerate the available display modes
|
||||||
* Try to get a complete match
|
* Try to get a complete match
|
||||||
*/
|
*/
|
||||||
while( EnumDisplaySettings( NULL, displayModes, &devMode ) == TRUE )
|
while( EnumDisplaySettings( NULL, displayModes, &devMode ) )
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* Does the enumerated display mode match the user's preferences?
|
* Does the enumerated display mode match the user's preferences?
|
||||||
@ -319,7 +319,7 @@ GLboolean fghChangeDisplayMode( GLboolean haveToTest )
|
|||||||
/*
|
/*
|
||||||
* Enumerate the available display modes
|
* Enumerate the available display modes
|
||||||
*/
|
*/
|
||||||
while( EnumDisplaySettings( NULL, displayModes, &devMode ) == TRUE )
|
while( EnumDisplaySettings( NULL, displayModes, &devMode ) )
|
||||||
{
|
{
|
||||||
/* then try without Display Frequency */
|
/* then try without Display Frequency */
|
||||||
if( fghCheckDisplayMode( devMode.dmPelsWidth,
|
if( fghCheckDisplayMode( devMode.dmPelsWidth,
|
||||||
@ -413,11 +413,11 @@ void FGAPIENTRY glutGameModeString( const char* string )
|
|||||||
int FGAPIENTRY glutEnterGameMode( void )
|
int FGAPIENTRY glutEnterGameMode( void )
|
||||||
{
|
{
|
||||||
if( fgStructure.GameMode )
|
if( fgStructure.GameMode )
|
||||||
fgAddToWindowDestroyList( fgStructure.GameMode, TRUE );
|
fgAddToWindowDestroyList( fgStructure.GameMode, GL_TRUE );
|
||||||
else
|
else
|
||||||
fghRememberState( );
|
fghRememberState( );
|
||||||
|
|
||||||
if( fghChangeDisplayMode( FALSE ) == FALSE )
|
if( ! fghChangeDisplayMode( GL_FALSE ) )
|
||||||
{
|
{
|
||||||
fgWarning( "failed to change screen settings" );
|
fgWarning( "failed to change screen settings" );
|
||||||
return FALSE;
|
return FALSE;
|
||||||
@ -425,7 +425,7 @@ int FGAPIENTRY glutEnterGameMode( void )
|
|||||||
|
|
||||||
fgStructure.GameMode = fgCreateWindow(
|
fgStructure.GameMode = fgCreateWindow(
|
||||||
NULL, "FREEGLUT", 0, 0,
|
NULL, "FREEGLUT", 0, 0,
|
||||||
fgState.GameModeSize.X, fgState.GameModeSize.Y, TRUE
|
fgState.GameModeSize.X, fgState.GameModeSize.Y, GL_TRUE
|
||||||
);
|
);
|
||||||
|
|
||||||
#if TARGET_HOST_UNIX_X11
|
#if TARGET_HOST_UNIX_X11
|
||||||
@ -534,7 +534,7 @@ void FGAPIENTRY glutLeaveGameMode( void )
|
|||||||
{
|
{
|
||||||
freeglut_return_if_fail( fgStructure.GameMode );
|
freeglut_return_if_fail( fgStructure.GameMode );
|
||||||
|
|
||||||
fgAddToWindowDestroyList( fgStructure.GameMode, TRUE );
|
fgAddToWindowDestroyList( fgStructure.GameMode, GL_TRUE );
|
||||||
|
|
||||||
#if TARGET_HOST_UNIX_X11
|
#if TARGET_HOST_UNIX_X11
|
||||||
|
|
||||||
@ -557,7 +557,7 @@ int FGAPIENTRY glutGameModeGet( GLenum eWhat )
|
|||||||
return !!fgStructure.GameMode;
|
return !!fgStructure.GameMode;
|
||||||
|
|
||||||
case GLUT_GAME_MODE_POSSIBLE:
|
case GLUT_GAME_MODE_POSSIBLE:
|
||||||
return fghChangeDisplayMode( TRUE );
|
return fghChangeDisplayMode( GL_TRUE );
|
||||||
|
|
||||||
case GLUT_GAME_MODE_WIDTH:
|
case GLUT_GAME_MODE_WIDTH:
|
||||||
return fgState.GameModeSize.X;
|
return fgState.GameModeSize.X;
|
||||||
|
@ -55,32 +55,32 @@ SFG_Display fgDisplay;
|
|||||||
/*
|
/*
|
||||||
* The settings for the current freeglut session
|
* The settings for the current freeglut session
|
||||||
*/
|
*/
|
||||||
SFG_State fgState = { { -1, -1, FALSE }, /* Position */
|
SFG_State fgState = { { -1, -1, GL_FALSE }, /* Position */
|
||||||
{ 300, 300, TRUE }, /* Size */
|
{ 300, 300, GL_TRUE }, /* Size */
|
||||||
GLUT_RGBA | GLUT_SINGLE | GLUT_DEPTH, /* DisplayMode */
|
GLUT_RGBA | GLUT_SINGLE | GLUT_DEPTH, /* DisplayMode */
|
||||||
FALSE, /* Initalized */
|
GL_FALSE, /* Initalized */
|
||||||
FALSE, /* ForceDirectContext */
|
GL_FALSE, /* ForceDirectContext */
|
||||||
TRUE, /* TryDirectContext */
|
GL_TRUE, /* TryDirectContext */
|
||||||
FALSE, /* ForceIconic */
|
GL_FALSE, /* ForceIconic */
|
||||||
FALSE, /* UseCurrentContext */
|
GL_FALSE, /* UseCurrentContext */
|
||||||
FALSE, /* GLDebugSwitch */
|
GL_FALSE, /* GLDebugSwitch */
|
||||||
FALSE, /* XSyncSwitch */
|
GL_FALSE, /* XSyncSwitch */
|
||||||
TRUE, /* IgnoreKeyRepeat */
|
GL_TRUE, /* IgnoreKeyRepeat */
|
||||||
0, /* FPSInterval */
|
0, /* FPSInterval */
|
||||||
0, /* SwapCount */
|
0, /* SwapCount */
|
||||||
0, /* SwapTime */
|
0, /* SwapTime */
|
||||||
#if TARGET_HOST_WIN32
|
#if TARGET_HOST_WIN32
|
||||||
{ 0, FALSE }, /* Time */
|
{ 0, GL_FALSE }, /* Time */
|
||||||
#else
|
#else
|
||||||
{ { 0, 0 }, FALSE },
|
{ { 0, 0 }, GL_FALSE },
|
||||||
#endif
|
#endif
|
||||||
{ NULL, NULL } , /* Timers */
|
{ NULL, NULL }, /* Timers */
|
||||||
NULL, /* IdleCallback */
|
NULL, /* IdleCallback */
|
||||||
FALSE, /* BuildingAMenu */
|
GL_FALSE, /* BuildingAMenu */
|
||||||
0, /* ActiveMenus */
|
0, /* ActiveMenus */
|
||||||
NULL, /* MenuStateCallback */
|
NULL, /* MenuStateCallback */
|
||||||
NULL, /* MenuStatusCallback */
|
NULL, /* MenuStatusCallback */
|
||||||
{ 640, 480, TRUE }, /* GameModeSize */
|
{ 640, 480, GL_TRUE }, /* GameModeSize */
|
||||||
16, /* GameModeDepth */
|
16, /* GameModeDepth */
|
||||||
72, /* GameModeRefresh */
|
72, /* GameModeRefresh */
|
||||||
GLUT_ACTION_EXIT, /* ActionOnWindowClose */
|
GLUT_ACTION_EXIT, /* ActionOnWindowClose */
|
||||||
@ -239,31 +239,31 @@ void fgDeinitialize( void )
|
|||||||
|
|
||||||
fgState.Position.X = -1;
|
fgState.Position.X = -1;
|
||||||
fgState.Position.Y = -1;
|
fgState.Position.Y = -1;
|
||||||
fgState.Position.Use = FALSE;
|
fgState.Position.Use = GL_FALSE;
|
||||||
|
|
||||||
fgState.Size.X = 300;
|
fgState.Size.X = 300;
|
||||||
fgState.Size.Y = 300;
|
fgState.Size.Y = 300;
|
||||||
fgState.Size.Use = TRUE;
|
fgState.Size.Use = GL_TRUE;
|
||||||
|
|
||||||
fgState.DisplayMode = GLUT_RGBA | GLUT_SINGLE | GLUT_DEPTH;
|
fgState.DisplayMode = GLUT_RGBA | GLUT_SINGLE | GLUT_DEPTH;
|
||||||
|
|
||||||
fgState.ForceDirectContext = FALSE;
|
fgState.ForceDirectContext = GL_FALSE;
|
||||||
fgState.TryDirectContext = TRUE;
|
fgState.TryDirectContext = GL_TRUE;
|
||||||
fgState.ForceIconic = FALSE;
|
fgState.ForceIconic = GL_FALSE;
|
||||||
fgState.UseCurrentContext = FALSE;
|
fgState.UseCurrentContext = GL_FALSE;
|
||||||
fgState.GLDebugSwitch = FALSE;
|
fgState.GLDebugSwitch = GL_FALSE;
|
||||||
fgState.XSyncSwitch = FALSE;
|
fgState.XSyncSwitch = GL_FALSE;
|
||||||
fgState.ActionOnWindowClose = GLUT_ACTION_EXIT ;
|
fgState.ActionOnWindowClose = GLUT_ACTION_EXIT ;
|
||||||
fgState.ExecState = GLUT_EXEC_STATE_INIT ;
|
fgState.ExecState = GLUT_EXEC_STATE_INIT ;
|
||||||
|
|
||||||
fgState.IgnoreKeyRepeat = TRUE;
|
fgState.IgnoreKeyRepeat = GL_TRUE;
|
||||||
|
|
||||||
fgState.GameModeSize.X = 640;
|
fgState.GameModeSize.X = 640;
|
||||||
fgState.GameModeSize.Y = 480;
|
fgState.GameModeSize.Y = 480;
|
||||||
fgState.GameModeDepth = 16;
|
fgState.GameModeDepth = 16;
|
||||||
fgState.GameModeRefresh = 72;
|
fgState.GameModeRefresh = 72;
|
||||||
|
|
||||||
fgState.Time.Set = FALSE;
|
fgState.Time.Set = GL_FALSE;
|
||||||
|
|
||||||
fgState.Timers.First = fgState.Timers.Last = NULL;
|
fgState.Timers.First = fgState.Timers.Last = NULL;
|
||||||
fgState.IdleCallback = NULL;
|
fgState.IdleCallback = NULL;
|
||||||
@ -401,39 +401,39 @@ void FGAPIENTRY glutInit( int* pargc, char** argv )
|
|||||||
}
|
}
|
||||||
else if( strcmp( argv[ i ], "-direct" ) == 0)
|
else if( strcmp( argv[ i ], "-direct" ) == 0)
|
||||||
{
|
{
|
||||||
if( fgState.TryDirectContext == FALSE )
|
if( ! fgState.TryDirectContext )
|
||||||
fgError( "parameters ambiguity, -direct and -indirect "
|
fgError( "parameters ambiguity, -direct and -indirect "
|
||||||
"cannot be both specified" );
|
"cannot be both specified" );
|
||||||
|
|
||||||
fgState.ForceDirectContext = TRUE;
|
fgState.ForceDirectContext = GL_TRUE;
|
||||||
argv[ i ] = NULL;
|
argv[ i ] = NULL;
|
||||||
( *pargc )--;
|
( *pargc )--;
|
||||||
}
|
}
|
||||||
else if( strcmp( argv[ i ], "-indirect" ) == 0 )
|
else if( strcmp( argv[ i ], "-indirect" ) == 0 )
|
||||||
{
|
{
|
||||||
if( fgState.ForceDirectContext == TRUE )
|
if( fgState.ForceDirectContext )
|
||||||
fgError( "parameters ambiguity, -direct and -indirect "
|
fgError( "parameters ambiguity, -direct and -indirect "
|
||||||
"cannot be both specified" );
|
"cannot be both specified" );
|
||||||
|
|
||||||
fgState.TryDirectContext = FALSE;
|
fgState.TryDirectContext = GL_FALSE;
|
||||||
argv[ i ] = NULL;
|
argv[ i ] = NULL;
|
||||||
(*pargc)--;
|
(*pargc)--;
|
||||||
}
|
}
|
||||||
else if( strcmp( argv[ i ], "-iconic" ) == 0 )
|
else if( strcmp( argv[ i ], "-iconic" ) == 0 )
|
||||||
{
|
{
|
||||||
fgState.ForceIconic = TRUE;
|
fgState.ForceIconic = GL_TRUE;
|
||||||
argv[ i ] = NULL;
|
argv[ i ] = NULL;
|
||||||
( *pargc )--;
|
( *pargc )--;
|
||||||
}
|
}
|
||||||
else if( strcmp( argv[ i ], "-gldebug" ) == 0 )
|
else if( strcmp( argv[ i ], "-gldebug" ) == 0 )
|
||||||
{
|
{
|
||||||
fgState.GLDebugSwitch = TRUE;
|
fgState.GLDebugSwitch = GL_TRUE;
|
||||||
argv[ i ] = NULL;
|
argv[ i ] = NULL;
|
||||||
( *pargc )--;
|
( *pargc )--;
|
||||||
}
|
}
|
||||||
else if( strcmp( argv[ i ], "-sync" ) == 0 )
|
else if( strcmp( argv[ i ], "-sync" ) == 0 )
|
||||||
{
|
{
|
||||||
fgState.XSyncSwitch = TRUE;
|
fgState.XSyncSwitch = GL_TRUE;
|
||||||
argv[ i ] = NULL;
|
argv[ i ] = NULL;
|
||||||
( *pargc )--;
|
( *pargc )--;
|
||||||
}
|
}
|
||||||
@ -471,10 +471,10 @@ void FGAPIENTRY glutInit( int* pargc, char** argv )
|
|||||||
* Check for the minus one settings for both position and size...
|
* Check for the minus one settings for both position and size...
|
||||||
*/
|
*/
|
||||||
if( fgState.Position.X < 0 || fgState.Position.Y < 0 )
|
if( fgState.Position.X < 0 || fgState.Position.Y < 0 )
|
||||||
fgState.Position.Use = FALSE;
|
fgState.Position.Use = GL_FALSE;
|
||||||
|
|
||||||
if( fgState.Size.X < 0 || fgState.Size.Y < 0 )
|
if( fgState.Size.X < 0 || fgState.Size.Y < 0 )
|
||||||
fgState.Size.Use = FALSE;
|
fgState.Size.Use = GL_FALSE;
|
||||||
|
|
||||||
if( displayName )
|
if( displayName )
|
||||||
free( displayName );
|
free( displayName );
|
||||||
@ -489,13 +489,13 @@ void FGAPIENTRY glutInitWindowPosition( int x, int y )
|
|||||||
{
|
{
|
||||||
fgState.Position.X = x;
|
fgState.Position.X = x;
|
||||||
fgState.Position.Y = y;
|
fgState.Position.Y = y;
|
||||||
fgState.Position.Use = TRUE;
|
fgState.Position.Use = GL_TRUE;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
fgState.Position.X = -1;
|
fgState.Position.X = -1;
|
||||||
fgState.Position.Y = -1;
|
fgState.Position.Y = -1;
|
||||||
fgState.Position.Use = FALSE;
|
fgState.Position.Use = GL_FALSE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -508,13 +508,13 @@ void FGAPIENTRY glutInitWindowSize( int width, int height )
|
|||||||
{
|
{
|
||||||
fgState.Size.X = width;
|
fgState.Size.X = width;
|
||||||
fgState.Size.Y = height;
|
fgState.Size.Y = height;
|
||||||
fgState.Size.Use = TRUE;
|
fgState.Size.Use = GL_TRUE;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
fgState.Size.X = -1;
|
fgState.Size.X = -1;
|
||||||
fgState.Size.Y = -1;
|
fgState.Size.Y = -1;
|
||||||
fgState.Size.Use = FALSE;
|
fgState.Size.Use = GL_FALSE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -709,7 +709,7 @@ SFG_Window* fgCreateWindow( SFG_Window* parent, const char* title,
|
|||||||
void fgSetWindow ( SFG_Window *window );
|
void fgSetWindow ( SFG_Window *window );
|
||||||
void fgOpenWindow( SFG_Window* window, const char* title,
|
void fgOpenWindow( SFG_Window* window, const char* title,
|
||||||
int x, int y, int w, int h, GLboolean gameMode,
|
int x, int y, int w, int h, GLboolean gameMode,
|
||||||
int isSubWindow );
|
GLboolean isSubWindow );
|
||||||
void fgCloseWindow( SFG_Window* window );
|
void fgCloseWindow( SFG_Window* window );
|
||||||
void fgAddToWindowDestroyList ( SFG_Window* window,
|
void fgAddToWindowDestroyList ( SFG_Window* window,
|
||||||
GLboolean needToClose );
|
GLboolean needToClose );
|
||||||
|
@ -185,7 +185,7 @@ static void fghJoystickRawRead( SFG_Joystick* joy, int* buttons, float* axes )
|
|||||||
|
|
||||||
if( status != JOYERR_NOERROR )
|
if( status != JOYERR_NOERROR )
|
||||||
{
|
{
|
||||||
joy->error = TRUE;
|
joy->error = GL_TRUE;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -230,7 +230,7 @@ static void fghJoystickRawRead( SFG_Joystick* joy, int* buttons, float* axes )
|
|||||||
}
|
}
|
||||||
|
|
||||||
fgWarning( "%s", joy->fname );
|
fgWarning( "%s", joy->fname );
|
||||||
joy->error = TRUE;
|
joy->error = GL_TRUE;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -261,7 +261,7 @@ static void fghJoystickRawRead( SFG_Joystick* joy, int* buttons, float* axes )
|
|||||||
if( status != JS_RETURN )
|
if( status != JS_RETURN )
|
||||||
{
|
{
|
||||||
fgWarning( "%s", joy->fname );
|
fgWarning( "%s", joy->fname );
|
||||||
joy->error = TRUE;
|
joy->error = GL_TRUE;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -394,7 +394,7 @@ static void fghJoystickOpen( SFG_Joystick* joy )
|
|||||||
* I guess we have no axes at all
|
* I guess we have no axes at all
|
||||||
*/
|
*/
|
||||||
default:
|
default:
|
||||||
joy->error = TRUE;
|
joy->error = GL_TRUE;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -508,7 +508,7 @@ static void fghJoystickOpen( SFG_Joystick* joy )
|
|||||||
joy->center[ 1 ] == 512.0f );
|
joy->center[ 1 ] == 512.0f );
|
||||||
|
|
||||||
if( counter >= 100 )
|
if( counter >= 100 )
|
||||||
joy->error = TRUE;
|
joy->error = GL_TRUE;
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
for( i = 0; i < _JS_MAX_AXES; i++ )
|
for( i = 0; i < _JS_MAX_AXES; i++ )
|
||||||
@ -551,7 +551,7 @@ void fgJoystickInit( int ident )
|
|||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
fgJoystick->num_axes = 0;
|
fgJoystick->num_axes = 0;
|
||||||
fgJoystick->error = TRUE;
|
fgJoystick->error = GL_TRUE;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
@ -579,7 +579,7 @@ void fgJoystickClose( void )
|
|||||||
fgError( "illegal attempt to deinitialize joystick device" );
|
fgError( "illegal attempt to deinitialize joystick device" );
|
||||||
|
|
||||||
#ifndef WIN32
|
#ifndef WIN32
|
||||||
if( fgJoystick->error != TRUE )
|
if( ! fgJoystick->error )
|
||||||
close( fgJoystick->fd );
|
close( fgJoystick->fd );
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -101,9 +101,9 @@ static void fghRedrawWindowByHandle
|
|||||||
* XXX the {window} pointer is defined.
|
* XXX the {window} pointer is defined.
|
||||||
*/
|
*/
|
||||||
freeglut_return_if_fail( FETCH_WCB( *window, Display ) );
|
freeglut_return_if_fail( FETCH_WCB( *window, Display ) );
|
||||||
freeglut_return_if_fail( window->State.Visible == TRUE );
|
freeglut_return_if_fail( window->State.Visible );
|
||||||
|
|
||||||
window->State.Redisplay = FALSE;
|
window->State.Redisplay = GL_FALSE;
|
||||||
INVOKE_WCB( *window, Display, ( ) );
|
INVOKE_WCB( *window, Display, ( ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -139,7 +139,7 @@ static void fghReshapeWindowByHandle
|
|||||||
* But without this we get this bad behaviour whenever we resize the
|
* But without this we get this bad behaviour whenever we resize the
|
||||||
* window.
|
* window.
|
||||||
*/
|
*/
|
||||||
window->State.Redisplay = TRUE;
|
window->State.Redisplay = GL_TRUE;
|
||||||
|
|
||||||
if( window->IsMenu )
|
if( window->IsMenu )
|
||||||
fgSetWindow( current_window );
|
fgSetWindow( current_window );
|
||||||
@ -161,12 +161,12 @@ static void fghcbDisplayWindow( SFG_Window *window, SFG_Enumerator *enumerator )
|
|||||||
* XXX loop if you didn't have a display callback defined...
|
* XXX loop if you didn't have a display callback defined...
|
||||||
*/
|
*/
|
||||||
if( ( FETCH_WCB( *window, Display ) ) &&
|
if( ( FETCH_WCB( *window, Display ) ) &&
|
||||||
( window->State.Redisplay == TRUE ) &&
|
window->State.Redisplay &&
|
||||||
( window->State.Visible == TRUE ) )
|
window->State.Visible )
|
||||||
{
|
{
|
||||||
SFG_Window *current_window = fgStructure.Window;
|
SFG_Window *current_window = fgStructure.Window;
|
||||||
|
|
||||||
window->State.Redisplay = FALSE;
|
window->State.Redisplay = GL_FALSE;
|
||||||
INVOKE_WCB( *window, Display, ( ) );
|
INVOKE_WCB( *window, Display, ( ) );
|
||||||
fgSetWindow( current_window );
|
fgSetWindow( current_window );
|
||||||
}
|
}
|
||||||
@ -185,7 +185,7 @@ static void fghcbDisplayWindow( SFG_Window *window, SFG_Enumerator *enumerator )
|
|||||||
glutGet( GLUT_WINDOW_HEIGHT )
|
glutGet( GLUT_WINDOW_HEIGHT )
|
||||||
);
|
);
|
||||||
|
|
||||||
window->State.NeedToResize = FALSE;
|
window->State.NeedToResize = GL_FALSE;
|
||||||
fgSetWindow ( current_window );
|
fgSetWindow ( current_window );
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -193,10 +193,10 @@ static void fghcbDisplayWindow( SFG_Window *window, SFG_Enumerator *enumerator )
|
|||||||
* XXX See above comment about the Redisplay flag...
|
* XXX See above comment about the Redisplay flag...
|
||||||
*/
|
*/
|
||||||
if( ( FETCH_WCB( *window, Display ) ) &&
|
if( ( FETCH_WCB( *window, Display ) ) &&
|
||||||
( window->State.Redisplay == TRUE ) &&
|
window->State.Redisplay &&
|
||||||
( window->State.Visible == TRUE ) )
|
window->State.Visible )
|
||||||
{
|
{
|
||||||
window->State.Redisplay = FALSE;
|
window->State.Redisplay = GL_FALSE;
|
||||||
|
|
||||||
RedrawWindow(
|
RedrawWindow(
|
||||||
window->Window.Handle, NULL, NULL,
|
window->Window.Handle, NULL, NULL,
|
||||||
@ -216,7 +216,7 @@ static void fghDisplayAll( void )
|
|||||||
{
|
{
|
||||||
SFG_Enumerator enumerator;
|
SFG_Enumerator enumerator;
|
||||||
|
|
||||||
enumerator.found = FALSE;
|
enumerator.found = GL_FALSE;
|
||||||
enumerator.data = NULL;
|
enumerator.data = NULL;
|
||||||
|
|
||||||
fgEnumWindows( fghcbDisplayWindow, &enumerator );
|
fgEnumWindows( fghcbDisplayWindow, &enumerator );
|
||||||
@ -247,7 +247,7 @@ static void fghCheckJoystickPolls( void )
|
|||||||
{
|
{
|
||||||
SFG_Enumerator enumerator;
|
SFG_Enumerator enumerator;
|
||||||
|
|
||||||
enumerator.found = FALSE;
|
enumerator.found = GL_FALSE;
|
||||||
enumerator.data = NULL;
|
enumerator.data = NULL;
|
||||||
|
|
||||||
fgEnumWindows( fghcbCheckJoystickPolls, &enumerator );
|
fgEnumWindows( fghcbCheckJoystickPolls, &enumerator );
|
||||||
@ -319,7 +319,7 @@ long fgElapsedTime( void )
|
|||||||
#elif TARGET_HOST_WIN32
|
#elif TARGET_HOST_WIN32
|
||||||
fgState.Time.Value = timeGetTime( );
|
fgState.Time.Value = timeGetTime( );
|
||||||
#endif
|
#endif
|
||||||
fgState.Time.Set = TRUE;
|
fgState.Time.Set = GL_TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -385,7 +385,7 @@ static void fgCheckJoystickCallback( SFG_Window* w, SFG_Enumerator* e )
|
|||||||
{
|
{
|
||||||
if( FETCH_WCB( *w, Joystick ) )
|
if( FETCH_WCB( *w, Joystick ) )
|
||||||
{
|
{
|
||||||
e->found = TRUE;
|
e->found = GL_TRUE;
|
||||||
e->data = w;
|
e->data = w;
|
||||||
}
|
}
|
||||||
fgEnumSubWindows( w, fgCheckJoystickCallback, e );
|
fgEnumSubWindows( w, fgCheckJoystickCallback, e );
|
||||||
@ -393,7 +393,7 @@ static void fgCheckJoystickCallback( SFG_Window* w, SFG_Enumerator* e )
|
|||||||
static int fgHaveJoystick( void )
|
static int fgHaveJoystick( void )
|
||||||
{
|
{
|
||||||
SFG_Enumerator enumerator;
|
SFG_Enumerator enumerator;
|
||||||
enumerator.found = FALSE;
|
enumerator.found = GL_FALSE;
|
||||||
enumerator.data = NULL;
|
enumerator.data = NULL;
|
||||||
fgEnumWindows( fgCheckJoystickCallback, &enumerator );
|
fgEnumWindows( fgCheckJoystickCallback, &enumerator );
|
||||||
return !!enumerator.data;
|
return !!enumerator.data;
|
||||||
@ -402,7 +402,7 @@ static void fgHavePendingRedisplaysCallback( SFG_Window* w, SFG_Enumerator* e )
|
|||||||
{
|
{
|
||||||
if( w->State.Redisplay )
|
if( w->State.Redisplay )
|
||||||
{
|
{
|
||||||
e->found = TRUE;
|
e->found = GL_TRUE;
|
||||||
e->data = w;
|
e->data = w;
|
||||||
}
|
}
|
||||||
fgEnumSubWindows( w, fgHavePendingRedisplaysCallback, e );
|
fgEnumSubWindows( w, fgHavePendingRedisplaysCallback, e );
|
||||||
@ -410,7 +410,7 @@ static void fgHavePendingRedisplaysCallback( SFG_Window* w, SFG_Enumerator* e )
|
|||||||
static int fgHavePendingRedisplays( void )
|
static int fgHavePendingRedisplays( void )
|
||||||
{
|
{
|
||||||
SFG_Enumerator enumerator;
|
SFG_Enumerator enumerator;
|
||||||
enumerator.found = FALSE;
|
enumerator.found = GL_FALSE;
|
||||||
enumerator.data = NULL;
|
enumerator.data = NULL;
|
||||||
fgEnumWindows( fgHavePendingRedisplaysCallback, &enumerator );
|
fgEnumWindows( fgHavePendingRedisplaysCallback, &enumerator );
|
||||||
return !!enumerator.data;
|
return !!enumerator.data;
|
||||||
@ -532,7 +532,7 @@ void FGAPIENTRY glutMainLoopEvent( void )
|
|||||||
GETWINDOW( xclient );
|
GETWINDOW( xclient );
|
||||||
|
|
||||||
fgCloseWindow ( window );
|
fgCloseWindow ( window );
|
||||||
fgAddToWindowDestroyList ( window, FALSE );
|
fgAddToWindowDestroyList ( window, GL_FALSE );
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -563,7 +563,7 @@ void FGAPIENTRY glutMainLoopEvent( void )
|
|||||||
* This is sent to confirm the XDestroyWindow call.
|
* This is sent to confirm the XDestroyWindow call.
|
||||||
* XXX WHY is this commented out? Should we re-enable it?
|
* XXX WHY is this commented out? Should we re-enable it?
|
||||||
*/
|
*/
|
||||||
/* fgAddToWindowDestroyList ( window, FALSE ); */
|
/* fgAddToWindowDestroyList ( window, GL_FALSE ); */
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case Expose:
|
case Expose:
|
||||||
@ -611,18 +611,18 @@ void FGAPIENTRY glutMainLoopEvent( void )
|
|||||||
{
|
{
|
||||||
case VisibilityUnobscured:
|
case VisibilityUnobscured:
|
||||||
INVOKE_WCB( *window, WindowStatus, ( GLUT_FULLY_RETAINED ) );
|
INVOKE_WCB( *window, WindowStatus, ( GLUT_FULLY_RETAINED ) );
|
||||||
window->State.Visible = TRUE;
|
window->State.Visible = GL_TRUE;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case VisibilityPartiallyObscured:
|
case VisibilityPartiallyObscured:
|
||||||
INVOKE_WCB( *window, WindowStatus,
|
INVOKE_WCB( *window, WindowStatus,
|
||||||
( GLUT_PARTIALLY_RETAINED ) );
|
( GLUT_PARTIALLY_RETAINED ) );
|
||||||
window->State.Visible = TRUE;
|
window->State.Visible = GL_TRUE;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case VisibilityFullyObscured:
|
case VisibilityFullyObscured:
|
||||||
INVOKE_WCB( *window, WindowStatus, ( GLUT_FULLY_COVERED ) );
|
INVOKE_WCB( *window, WindowStatus, ( GLUT_FULLY_COVERED ) );
|
||||||
window->State.Visible = FALSE;
|
window->State.Visible = GL_FALSE;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
@ -656,7 +656,7 @@ void FGAPIENTRY glutMainLoopEvent( void )
|
|||||||
window->ActiveMenu->Window->State.MouseY =
|
window->ActiveMenu->Window->State.MouseY =
|
||||||
event.xmotion.y_root - window->ActiveMenu->Y;
|
event.xmotion.y_root - window->ActiveMenu->Y;
|
||||||
}
|
}
|
||||||
window->ActiveMenu->Window->State.Redisplay = TRUE;
|
window->ActiveMenu->Window->State.Redisplay = GL_TRUE;
|
||||||
fgSetWindow( window->ActiveMenu->ParentWindow );
|
fgSetWindow( window->ActiveMenu->ParentWindow );
|
||||||
|
|
||||||
break;
|
break;
|
||||||
@ -680,11 +680,11 @@ void FGAPIENTRY glutMainLoopEvent( void )
|
|||||||
case ButtonRelease:
|
case ButtonRelease:
|
||||||
case ButtonPress:
|
case ButtonPress:
|
||||||
{
|
{
|
||||||
GLboolean pressed = TRUE;
|
GLboolean pressed = GL_TRUE;
|
||||||
int button;
|
int button;
|
||||||
|
|
||||||
if( event.type == ButtonRelease )
|
if( event.type == ButtonRelease )
|
||||||
pressed = FALSE;
|
pressed = GL_FALSE;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* A mouse button has been pressed or released. Traditionally,
|
* A mouse button has been pressed or released. Traditionally,
|
||||||
@ -737,7 +737,7 @@ void FGAPIENTRY glutMainLoopEvent( void )
|
|||||||
|
|
||||||
/* In the menu, invoke the callback and deactivate the menu*/
|
/* In the menu, invoke the callback and deactivate the menu*/
|
||||||
if( fgCheckActiveMenu( window->ActiveMenu->Window,
|
if( fgCheckActiveMenu( window->ActiveMenu->Window,
|
||||||
window->ActiveMenu ) == TRUE )
|
window->ActiveMenu ) )
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* Save the current window and menu and set the current
|
* Save the current window and menu and set the current
|
||||||
@ -767,7 +767,7 @@ void FGAPIENTRY glutMainLoopEvent( void )
|
|||||||
*/
|
*/
|
||||||
fgDeactivateMenu( window->ActiveMenu->ParentWindow );
|
fgDeactivateMenu( window->ActiveMenu->ParentWindow );
|
||||||
|
|
||||||
window->State.Redisplay = TRUE;
|
window->State.Redisplay = GL_TRUE;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -779,7 +779,7 @@ void FGAPIENTRY glutMainLoopEvent( void )
|
|||||||
( window->Menu[ button ] ) &&
|
( window->Menu[ button ] ) &&
|
||||||
pressed )
|
pressed )
|
||||||
{
|
{
|
||||||
window->State.Redisplay = TRUE;
|
window->State.Redisplay = GL_TRUE;
|
||||||
fgSetWindow( window );
|
fgSetWindow( window );
|
||||||
fgActivateMenu( window, button );
|
fgActivateMenu( window, button );
|
||||||
break;
|
break;
|
||||||
@ -1104,7 +1104,7 @@ LRESULT CALLBACK fgWindowProc( HWND hWnd, UINT uMsg, WPARAM wParam,
|
|||||||
{
|
{
|
||||||
unsigned int current_DisplayMode = fgState.DisplayMode;
|
unsigned int current_DisplayMode = fgState.DisplayMode;
|
||||||
fgState.DisplayMode = GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH;
|
fgState.DisplayMode = GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH;
|
||||||
fgSetupPixelFormat( window, FALSE, PFD_MAIN_PLANE );
|
fgSetupPixelFormat( window, GL_FALSE, PFD_MAIN_PLANE );
|
||||||
fgState.DisplayMode = current_DisplayMode;
|
fgState.DisplayMode = current_DisplayMode;
|
||||||
|
|
||||||
if( fgStructure.MenuContext )
|
if( fgStructure.MenuContext )
|
||||||
@ -1124,9 +1124,9 @@ LRESULT CALLBACK fgWindowProc( HWND hWnd, UINT uMsg, WPARAM wParam,
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
fgSetupPixelFormat( window, FALSE, PFD_MAIN_PLANE );
|
fgSetupPixelFormat( window, GL_FALSE, PFD_MAIN_PLANE );
|
||||||
|
|
||||||
if( fgState.UseCurrentContext != TRUE )
|
if( ! fgState.UseCurrentContext )
|
||||||
window->Window.Context =
|
window->Window.Context =
|
||||||
wglCreateContext( window->Window.Device );
|
wglCreateContext( window->Window.Device );
|
||||||
else
|
else
|
||||||
@ -1138,7 +1138,7 @@ LRESULT CALLBACK fgWindowProc( HWND hWnd, UINT uMsg, WPARAM wParam,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
window->State.NeedToResize = TRUE;
|
window->State.NeedToResize = GL_TRUE;
|
||||||
ReleaseDC( window->Window.Handle, window->Window.Device );
|
ReleaseDC( window->Window.Handle, window->Window.Device );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -1221,8 +1221,8 @@ LRESULT CALLBACK fgWindowProc( HWND hWnd, UINT uMsg, WPARAM wParam,
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case WM_SHOWWINDOW:
|
case WM_SHOWWINDOW:
|
||||||
window->State.Visible = TRUE;
|
window->State.Visible = GL_TRUE;
|
||||||
window->State.Redisplay = TRUE;
|
window->State.Redisplay = GL_TRUE;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case WM_PAINT:
|
case WM_PAINT:
|
||||||
@ -1264,7 +1264,7 @@ LRESULT CALLBACK fgWindowProc( HWND hWnd, UINT uMsg, WPARAM wParam,
|
|||||||
* Put on a linked list of windows to be removed after all the
|
* Put on a linked list of windows to be removed after all the
|
||||||
* callbacks have returned
|
* callbacks have returned
|
||||||
*/
|
*/
|
||||||
fgAddToWindowDestroyList( window, FALSE );
|
fgAddToWindowDestroyList( window, GL_FALSE );
|
||||||
DestroyWindow( hWnd );
|
DestroyWindow( hWnd );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -1281,7 +1281,7 @@ LRESULT CALLBACK fgWindowProc( HWND hWnd, UINT uMsg, WPARAM wParam,
|
|||||||
|
|
||||||
if ( window->ActiveMenu )
|
if ( window->ActiveMenu )
|
||||||
{
|
{
|
||||||
window->State.Redisplay = TRUE;
|
window->State.Redisplay = GL_TRUE;
|
||||||
fgSetWindow ( window->ActiveMenu->ParentWindow );
|
fgSetWindow ( window->ActiveMenu->ParentWindow );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -1308,7 +1308,7 @@ LRESULT CALLBACK fgWindowProc( HWND hWnd, UINT uMsg, WPARAM wParam,
|
|||||||
case WM_MBUTTONUP:
|
case WM_MBUTTONUP:
|
||||||
case WM_RBUTTONUP:
|
case WM_RBUTTONUP:
|
||||||
{
|
{
|
||||||
GLboolean pressed = TRUE;
|
GLboolean pressed = GL_TRUE;
|
||||||
int button;
|
int button;
|
||||||
|
|
||||||
window->State.MouseX = LOWORD( lParam );
|
window->State.MouseX = LOWORD( lParam );
|
||||||
@ -1317,7 +1317,7 @@ LRESULT CALLBACK fgWindowProc( HWND hWnd, UINT uMsg, WPARAM wParam,
|
|||||||
/*
|
/*
|
||||||
* XXX Either these multi-statement lines should be broken
|
* XXX Either these multi-statement lines should be broken
|
||||||
* XXX in the form:
|
* XXX in the form:
|
||||||
* XXX pressed = TRUE;
|
* XXX pressed = GL_TRUE;
|
||||||
* XXX button = GLUT_LEFT_BUTTON;
|
* XXX button = GLUT_LEFT_BUTTON;
|
||||||
* XXX break;
|
* XXX break;
|
||||||
* XXX ...or we should use a macro (much as I dislike freeglut's
|
* XXX ...or we should use a macro (much as I dislike freeglut's
|
||||||
@ -1326,19 +1326,19 @@ LRESULT CALLBACK fgWindowProc( HWND hWnd, UINT uMsg, WPARAM wParam,
|
|||||||
switch( uMsg )
|
switch( uMsg )
|
||||||
{
|
{
|
||||||
case WM_LBUTTONDOWN:
|
case WM_LBUTTONDOWN:
|
||||||
pressed = TRUE; button = GLUT_LEFT_BUTTON; break;
|
pressed = GL_TRUE; button = GLUT_LEFT_BUTTON; break;
|
||||||
case WM_MBUTTONDOWN:
|
case WM_MBUTTONDOWN:
|
||||||
pressed = TRUE; button = GLUT_MIDDLE_BUTTON; break;
|
pressed = GL_TRUE; button = GLUT_MIDDLE_BUTTON; break;
|
||||||
case WM_RBUTTONDOWN:
|
case WM_RBUTTONDOWN:
|
||||||
pressed = TRUE; button = GLUT_RIGHT_BUTTON; break;
|
pressed = GL_TRUE; button = GLUT_RIGHT_BUTTON; break;
|
||||||
case WM_LBUTTONUP:
|
case WM_LBUTTONUP:
|
||||||
pressed = FALSE; button = GLUT_LEFT_BUTTON; break;
|
pressed = GL_FALSE; button = GLUT_LEFT_BUTTON; break;
|
||||||
case WM_MBUTTONUP:
|
case WM_MBUTTONUP:
|
||||||
pressed = FALSE; button = GLUT_MIDDLE_BUTTON; break;
|
pressed = GL_FALSE; button = GLUT_MIDDLE_BUTTON; break;
|
||||||
case WM_RBUTTONUP:
|
case WM_RBUTTONUP:
|
||||||
pressed = FALSE; button = GLUT_RIGHT_BUTTON; break;
|
pressed = GL_FALSE; button = GLUT_RIGHT_BUTTON; break;
|
||||||
default:
|
default:
|
||||||
pressed = FALSE; button = -1; break;
|
pressed = GL_FALSE; button = -1; break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( GetSystemMetrics( SM_SWAPBUTTON ) )
|
if( GetSystemMetrics( SM_SWAPBUTTON ) )
|
||||||
@ -1374,9 +1374,9 @@ LRESULT CALLBACK fgWindowProc( HWND hWnd, UINT uMsg, WPARAM wParam,
|
|||||||
if( window->ActiveMenu )
|
if( window->ActiveMenu )
|
||||||
{
|
{
|
||||||
/* Outside the menu, deactivate the menu if it's a downclick */
|
/* Outside the menu, deactivate the menu if it's a downclick */
|
||||||
if( fgCheckActiveMenu( window, window->ActiveMenu ) != TRUE )
|
if( ! fgCheckActiveMenu( window, window->ActiveMenu ) )
|
||||||
{
|
{
|
||||||
if( pressed == TRUE )
|
if( pressed )
|
||||||
fgDeactivateMenu( window->ActiveMenu->ParentWindow );
|
fgDeactivateMenu( window->ActiveMenu->ParentWindow );
|
||||||
}
|
}
|
||||||
else /* In menu, invoke the callback and deactivate the menu*/
|
else /* In menu, invoke the callback and deactivate the menu*/
|
||||||
@ -1405,14 +1405,14 @@ LRESULT CALLBACK fgWindowProc( HWND hWnd, UINT uMsg, WPARAM wParam,
|
|||||||
* click and menu activity.
|
* click and menu activity.
|
||||||
*/
|
*/
|
||||||
if( ! window->IsMenu )
|
if( ! window->IsMenu )
|
||||||
window->State.Redisplay = TRUE;
|
window->State.Redisplay = GL_TRUE;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( ( window->Menu[ button ] ) && ( pressed == TRUE ) )
|
if ( window->Menu[ button ] && pressed )
|
||||||
{
|
{
|
||||||
window->State.Redisplay = TRUE;
|
window->State.Redisplay = GL_TRUE;
|
||||||
fgSetWindow( window );
|
fgSetWindow( window );
|
||||||
fgActivateMenu( window, button );
|
fgActivateMenu( window, button );
|
||||||
|
|
||||||
@ -1428,7 +1428,7 @@ LRESULT CALLBACK fgWindowProc( HWND hWnd, UINT uMsg, WPARAM wParam,
|
|||||||
INVOKE_WCB(
|
INVOKE_WCB(
|
||||||
*window, Mouse,
|
*window, Mouse,
|
||||||
( button,
|
( button,
|
||||||
pressed == TRUE ? GLUT_DOWN : GLUT_UP,
|
pressed ? GLUT_DOWN : GLUT_UP,
|
||||||
window->State.MouseX,
|
window->State.MouseX,
|
||||||
window->State.MouseY
|
window->State.MouseY
|
||||||
)
|
)
|
||||||
@ -1713,7 +1713,7 @@ LRESULT CALLBACK fgWindowProc( HWND hWnd, UINT uMsg, WPARAM wParam,
|
|||||||
|
|
||||||
case WM_SYNCPAINT: /* 0x0088 */
|
case WM_SYNCPAINT: /* 0x0088 */
|
||||||
/* Another window has moved, need to update this one */
|
/* Another window has moved, need to update this one */
|
||||||
window->State.Redisplay = TRUE;
|
window->State.Redisplay = GL_TRUE;
|
||||||
lRet = DefWindowProc( hWnd, uMsg, wParam, lParam );
|
lRet = DefWindowProc( hWnd, uMsg, wParam, lParam );
|
||||||
/* Help screen says this message must be passed to "DefWindowProc" */
|
/* Help screen says this message must be passed to "DefWindowProc" */
|
||||||
break;
|
break;
|
||||||
|
@ -124,7 +124,7 @@ static GLboolean fghCheckMenuStatus( SFG_Window* window, SFG_Menu* menu )
|
|||||||
menuEntry;
|
menuEntry;
|
||||||
menuEntry = (SFG_MenuEntry *)menuEntry->Node.Next )
|
menuEntry = (SFG_MenuEntry *)menuEntry->Node.Next )
|
||||||
{
|
{
|
||||||
if( menuEntry->SubMenu && ( menuEntry->IsActive == TRUE ) )
|
if( menuEntry->SubMenu && menuEntry->IsActive )
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* OK, have the sub-menu checked, too. If it returns TRUE, it
|
* OK, have the sub-menu checked, too. If it returns TRUE, it
|
||||||
@ -138,9 +138,9 @@ static GLboolean fghCheckMenuStatus( SFG_Window* window, SFG_Menu* menu )
|
|||||||
* Reactivate the submenu as the checkMenuStatus may have turned
|
* Reactivate the submenu as the checkMenuStatus may have turned
|
||||||
* it off if the mouse is in its parent menu entry.
|
* it off if the mouse is in its parent menu entry.
|
||||||
*/
|
*/
|
||||||
menuEntry->SubMenu->IsActive = TRUE;
|
menuEntry->SubMenu->IsActive = GL_TRUE;
|
||||||
if ( return_status == TRUE )
|
if ( return_status )
|
||||||
return TRUE;
|
return GL_TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -153,9 +153,9 @@ static GLboolean fghCheckMenuStatus( SFG_Window* window, SFG_Menu* menu )
|
|||||||
for( menuEntry = (SFG_MenuEntry *)menu->Entries.First;
|
for( menuEntry = (SFG_MenuEntry *)menu->Entries.First;
|
||||||
menuEntry;
|
menuEntry;
|
||||||
menuEntry = (SFG_MenuEntry *)menuEntry->Node.Next )
|
menuEntry = (SFG_MenuEntry *)menuEntry->Node.Next )
|
||||||
menuEntry->IsActive = FALSE;
|
menuEntry->IsActive = GL_FALSE;
|
||||||
|
|
||||||
menu->IsActive = FALSE;
|
menu->IsActive = GL_FALSE;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Check if the mouse cursor is contained within the current menu box
|
* Check if the mouse cursor is contained within the current menu box
|
||||||
@ -174,7 +174,7 @@ static GLboolean fghCheckMenuStatus( SFG_Window* window, SFG_Menu* menu )
|
|||||||
menuEntry = fghFindMenuEntry( menu, menuID + 1 );
|
menuEntry = fghFindMenuEntry( menu, menuID + 1 );
|
||||||
assert( menuEntry );
|
assert( menuEntry );
|
||||||
|
|
||||||
menuEntry->IsActive = TRUE;
|
menuEntry->IsActive = GL_TRUE;
|
||||||
menuEntry->Ordinal = menuID;
|
menuEntry->Ordinal = menuID;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -187,7 +187,7 @@ static GLboolean fghCheckMenuStatus( SFG_Window* window, SFG_Menu* menu )
|
|||||||
fgDeactivateSubMenu( menu->ActiveEntry );
|
fgDeactivateSubMenu( menu->ActiveEntry );
|
||||||
|
|
||||||
menu->ActiveEntry = menuEntry;
|
menu->ActiveEntry = menuEntry;
|
||||||
menu->IsActive = TRUE;
|
menu->IsActive = GL_TRUE;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* OKi, we have marked that entry as active, but it would be also
|
* OKi, we have marked that entry as active, but it would be also
|
||||||
@ -203,7 +203,7 @@ static GLboolean fghCheckMenuStatus( SFG_Window* window, SFG_Menu* menu )
|
|||||||
/*
|
/*
|
||||||
* Set up the initial menu position now...
|
* Set up the initial menu position now...
|
||||||
*/
|
*/
|
||||||
menuEntry->SubMenu->IsActive = TRUE;
|
menuEntry->SubMenu->IsActive = GL_TRUE;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Set up the initial submenu position now:
|
* Set up the initial submenu position now:
|
||||||
@ -239,19 +239,19 @@ static GLboolean fghCheckMenuStatus( SFG_Window* window, SFG_Menu* menu )
|
|||||||
/*
|
/*
|
||||||
* Activate it because its parent entry is active
|
* Activate it because its parent entry is active
|
||||||
*/
|
*/
|
||||||
menuEntry->SubMenu->IsActive = TRUE;
|
menuEntry->SubMenu->IsActive = GL_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Report back that we have caught the menu cursor
|
* Report back that we have caught the menu cursor
|
||||||
*/
|
*/
|
||||||
return TRUE;
|
return GL_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Looks like the menu cursor is somewhere else...
|
* Looks like the menu cursor is somewhere else...
|
||||||
*/
|
*/
|
||||||
return FALSE;
|
return GL_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -307,7 +307,7 @@ static void fghDisplayMenuBox( SFG_Menu* menu )
|
|||||||
/*
|
/*
|
||||||
* Has the menu been marked as active, maybe?
|
* Has the menu been marked as active, maybe?
|
||||||
*/
|
*/
|
||||||
if( menuEntry->IsActive == TRUE )
|
if( menuEntry->IsActive )
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* That's truly right, and we need to have it highlighted.
|
* That's truly right, and we need to have it highlighted.
|
||||||
@ -397,7 +397,7 @@ static void fghDisplayMenuBox( SFG_Menu* menu )
|
|||||||
/*
|
/*
|
||||||
* Is that an active sub menu by any case?
|
* Is that an active sub menu by any case?
|
||||||
*/
|
*/
|
||||||
if( menuEntry->SubMenu && ( menuEntry->IsActive == TRUE ) )
|
if( menuEntry->SubMenu && menuEntry->IsActive )
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* Yeah, indeed. Have it redrawn now:
|
* Yeah, indeed. Have it redrawn now:
|
||||||
@ -495,7 +495,7 @@ void fgActivateMenu( SFG_Window* window, int button )
|
|||||||
* Mark the menu as active, so that it gets displayed:
|
* Mark the menu as active, so that it gets displayed:
|
||||||
*/
|
*/
|
||||||
window->ActiveMenu = menu;
|
window->ActiveMenu = menu;
|
||||||
menu->IsActive = TRUE;
|
menu->IsActive = GL_TRUE;
|
||||||
fgState.ActiveMenus++;
|
fgState.ActiveMenus++;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -552,7 +552,7 @@ void fgExecuteMenuCallback( SFG_Menu* menu )
|
|||||||
menuEntry;
|
menuEntry;
|
||||||
menuEntry = (SFG_MenuEntry *)menuEntry->Node.Next)
|
menuEntry = (SFG_MenuEntry *)menuEntry->Node.Next)
|
||||||
{
|
{
|
||||||
if( menuEntry->IsActive == TRUE )
|
if( menuEntry->IsActive )
|
||||||
{
|
{
|
||||||
if( menuEntry->SubMenu )
|
if( menuEntry->SubMenu )
|
||||||
fgExecuteMenuCallback( menuEntry->SubMenu );
|
fgExecuteMenuCallback( menuEntry->SubMenu );
|
||||||
@ -593,7 +593,7 @@ void fgDeactivateMenu( SFG_Window *window )
|
|||||||
*/
|
*/
|
||||||
menu->Window->ActiveMenu = NULL;
|
menu->Window->ActiveMenu = NULL;
|
||||||
menu->ParentWindow->ActiveMenu = NULL;
|
menu->ParentWindow->ActiveMenu = NULL;
|
||||||
menu->IsActive = FALSE;
|
menu->IsActive = GL_FALSE;
|
||||||
|
|
||||||
fgState.ActiveMenus--;
|
fgState.ActiveMenus--;
|
||||||
|
|
||||||
@ -631,7 +631,7 @@ void fgDeactivateSubMenu( SFG_MenuEntry *menuEntry )
|
|||||||
* Forget about having that menu active anymore, now:
|
* Forget about having that menu active anymore, now:
|
||||||
*/
|
*/
|
||||||
menuEntry->SubMenu->Window->ActiveMenu = NULL;
|
menuEntry->SubMenu->Window->ActiveMenu = NULL;
|
||||||
menuEntry->SubMenu->IsActive = FALSE;
|
menuEntry->SubMenu->IsActive = GL_FALSE;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Hide all submenu windows, and the root menu's window.
|
* Hide all submenu windows, and the root menu's window.
|
||||||
|
@ -99,7 +99,7 @@ void FGAPIENTRY glutReportErrors( void )
|
|||||||
*/
|
*/
|
||||||
void FGAPIENTRY glutIgnoreKeyRepeat( int ignore )
|
void FGAPIENTRY glutIgnoreKeyRepeat( int ignore )
|
||||||
{
|
{
|
||||||
fgState.IgnoreKeyRepeat = ignore ? TRUE : FALSE;
|
fgState.IgnoreKeyRepeat = ignore ? GL_TRUE : GL_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -105,7 +105,7 @@ void FGAPIENTRY glutSetOption( GLenum eWhat, int value )
|
|||||||
|
|
||||||
case GLUT_RENDERING_CONTEXT:
|
case GLUT_RENDERING_CONTEXT:
|
||||||
fgState.UseCurrentContext =
|
fgState.UseCurrentContext =
|
||||||
( value == GLUT_USE_CURRENT_CONTEXT ) ? TRUE : FALSE;
|
( value == GLUT_USE_CURRENT_CONTEXT ) ? GL_TRUE : GL_FALSE;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case GLUT_WINDOW_CURSOR:
|
case GLUT_WINDOW_CURSOR:
|
||||||
@ -400,7 +400,8 @@ int FGAPIENTRY glutGet( GLenum eWhat )
|
|||||||
return ( GetSystemMetrics( SM_CYCAPTION ) ) ;
|
return ( GetSystemMetrics( SM_CYCAPTION ) ) ;
|
||||||
|
|
||||||
case GLUT_DISPLAY_MODE_POSSIBLE:
|
case GLUT_DISPLAY_MODE_POSSIBLE:
|
||||||
return( fgSetupPixelFormat( fgStructure.Window, TRUE, PFD_MAIN_PLANE ) );
|
return( fgSetupPixelFormat( fgStructure.Window, GL_TRUE,
|
||||||
|
PFD_MAIN_PLANE ) );
|
||||||
|
|
||||||
case GLUT_WINDOW_FORMAT_ID:
|
case GLUT_WINDOW_FORMAT_ID:
|
||||||
if( fgStructure.Window != NULL )
|
if( fgStructure.Window != NULL )
|
||||||
@ -620,7 +621,8 @@ int FGAPIENTRY glutLayerGet( GLenum eWhat )
|
|||||||
#elif TARGET_HOST_WIN32
|
#elif TARGET_HOST_WIN32
|
||||||
|
|
||||||
case GLUT_OVERLAY_POSSIBLE:
|
case GLUT_OVERLAY_POSSIBLE:
|
||||||
/* return( fgSetupPixelFormat( fgStructure.Window, TRUE, PFD_OVERLAY_PLANE ) ); */
|
/* return( fgSetupPixelFormat( fgStructure.Window, GL_TRUE,
|
||||||
|
PFD_OVERLAY_PLANE ) ); */
|
||||||
return FALSE ;
|
return FALSE ;
|
||||||
|
|
||||||
case GLUT_LAYER_IN_USE:
|
case GLUT_LAYER_IN_USE:
|
||||||
|
@ -113,7 +113,7 @@ SFG_Window* fgCreateWindow( SFG_Window* parent, const char* title,
|
|||||||
* dependant, and resides in freeglut_window.c. Uses fgState.
|
* dependant, and resides in freeglut_window.c. Uses fgState.
|
||||||
*/
|
*/
|
||||||
fgOpenWindow( window, title, x, y, w, h, gameMode,
|
fgOpenWindow( window, title, x, y, w, h, gameMode,
|
||||||
(parent != NULL) ? TRUE : FALSE );
|
parent ? GL_TRUE : GL_FALSE );
|
||||||
|
|
||||||
return window;
|
return window;
|
||||||
}
|
}
|
||||||
@ -146,9 +146,9 @@ SFG_Menu* fgCreateMenu( FGCBMenu menuCallback )
|
|||||||
* global variable BuildingAMenu to true so we can ensure
|
* global variable BuildingAMenu to true so we can ensure
|
||||||
* it is created without decorations.
|
* it is created without decorations.
|
||||||
*/
|
*/
|
||||||
fgState.BuildingAMenu = TRUE;
|
fgState.BuildingAMenu = GL_TRUE;
|
||||||
|
|
||||||
fgCreateWindow( NULL, NULL, x, y, w, h, FALSE );
|
fgCreateWindow( NULL, NULL, x, y, w, h, GL_FALSE );
|
||||||
menu->Window = fgStructure.Window;
|
menu->Window = fgStructure.Window;
|
||||||
glutDisplayFunc( fgDisplayMenu );
|
glutDisplayFunc( fgDisplayMenu );
|
||||||
|
|
||||||
@ -156,7 +156,7 @@ SFG_Menu* fgCreateMenu( FGCBMenu menuCallback )
|
|||||||
* While BuildingAMenu is true, all windows built have no decorations.
|
* While BuildingAMenu is true, all windows built have no decorations.
|
||||||
* That's not a good default behavior, so let's set it false again.
|
* That's not a good default behavior, so let's set it false again.
|
||||||
*/
|
*/
|
||||||
fgState.BuildingAMenu = FALSE;
|
fgState.BuildingAMenu = GL_FALSE;
|
||||||
|
|
||||||
glutHideWindow( ); /* Hide the window for now */
|
glutHideWindow( ); /* Hide the window for now */
|
||||||
fgSetWindow( current_window );
|
fgSetWindow( current_window );
|
||||||
@ -318,7 +318,7 @@ void fgDestroyWindow( SFG_Window* window, GLboolean needToClose )
|
|||||||
}
|
}
|
||||||
|
|
||||||
fgClearCallBacks( window );
|
fgClearCallBacks( window );
|
||||||
if( needToClose == TRUE )
|
if( needToClose )
|
||||||
fgCloseWindow( window );
|
fgCloseWindow( window );
|
||||||
free( window );
|
free( window );
|
||||||
if( fgStructure.Window == window )
|
if( fgStructure.Window == window )
|
||||||
@ -425,7 +425,7 @@ void fgDestroyMenu( SFG_Menu* menu )
|
|||||||
|
|
||||||
if( fgStructure.Window == menu->Window )
|
if( fgStructure.Window == menu->Window )
|
||||||
fgSetWindow( menu->ParentWindow );
|
fgSetWindow( menu->ParentWindow );
|
||||||
fgDestroyWindow( menu->Window, TRUE );
|
fgDestroyWindow( menu->Window, GL_TRUE );
|
||||||
fgListRemove( &fgStructure.Menus, &menu->Node );
|
fgListRemove( &fgStructure.Menus, &menu->Node );
|
||||||
if( fgStructure.Menu == menu )
|
if( fgStructure.Menu == menu )
|
||||||
fgStructure.Menu = NULL;
|
fgStructure.Menu = NULL;
|
||||||
@ -470,7 +470,7 @@ void fgDestroyStructure( void )
|
|||||||
fgDestroyMenu( menu );
|
fgDestroyMenu( menu );
|
||||||
|
|
||||||
while( window = ( SFG_Window * )fgStructure.Windows.First )
|
while( window = ( SFG_Window * )fgStructure.Windows.First )
|
||||||
fgDestroyWindow( window, TRUE );
|
fgDestroyWindow( window, GL_TRUE );
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -491,7 +491,7 @@ void fgEnumWindows( FGCBenumerator enumCallback, SFG_Enumerator* enumerator )
|
|||||||
window = ( SFG_Window * )window->Node.Next )
|
window = ( SFG_Window * )window->Node.Next )
|
||||||
{
|
{
|
||||||
enumCallback( window, enumerator );
|
enumCallback( window, enumerator );
|
||||||
if( enumerator->found == TRUE )
|
if( enumerator->found )
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -513,7 +513,7 @@ void fgEnumSubWindows( SFG_Window* window, FGCBenumerator enumCallback,
|
|||||||
child = ( SFG_Window * )child->Node.Next )
|
child = ( SFG_Window * )child->Node.Next )
|
||||||
{
|
{
|
||||||
enumCallback( child, enumerator );
|
enumCallback( child, enumerator );
|
||||||
if( enumerator->found == TRUE )
|
if( enumerator->found )
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -524,7 +524,8 @@ void fgEnumSubWindows( SFG_Window* window, FGCBenumerator enumCallback,
|
|||||||
static void fghcbWindowByHandle( SFG_Window *window,
|
static void fghcbWindowByHandle( SFG_Window *window,
|
||||||
SFG_Enumerator *enumerator )
|
SFG_Enumerator *enumerator )
|
||||||
{
|
{
|
||||||
freeglut_return_if_fail( enumerator->found == FALSE );
|
if ( enumerator->found )
|
||||||
|
return;
|
||||||
|
|
||||||
#if TARGET_HOST_UNIX_X11
|
#if TARGET_HOST_UNIX_X11
|
||||||
#define WBHANDLE (Window)
|
#define WBHANDLE (Window)
|
||||||
@ -537,7 +538,7 @@ static void fghcbWindowByHandle( SFG_Window *window,
|
|||||||
*/
|
*/
|
||||||
if( window->Window.Handle == WBHANDLE (enumerator->data) )
|
if( window->Window.Handle == WBHANDLE (enumerator->data) )
|
||||||
{
|
{
|
||||||
enumerator->found = TRUE;
|
enumerator->found = GL_TRUE;
|
||||||
enumerator->data = window;
|
enumerator->data = window;
|
||||||
|
|
||||||
return;
|
return;
|
||||||
@ -568,11 +569,11 @@ SFG_Window* fgWindowByHandle
|
|||||||
/*
|
/*
|
||||||
* This is easy and makes use of the windows enumeration defined above
|
* This is easy and makes use of the windows enumeration defined above
|
||||||
*/
|
*/
|
||||||
enumerator.found = FALSE;
|
enumerator.found = GL_FALSE;
|
||||||
enumerator.data = (void *)hWindow;
|
enumerator.data = (void *)hWindow;
|
||||||
fgEnumWindows( fghcbWindowByHandle, &enumerator );
|
fgEnumWindows( fghcbWindowByHandle, &enumerator );
|
||||||
|
|
||||||
if( enumerator.found == TRUE )
|
if( enumerator.found )
|
||||||
return( SFG_Window *) enumerator.data;
|
return( SFG_Window *) enumerator.data;
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
@ -585,14 +586,15 @@ static void fghcbWindowByID( SFG_Window *window, SFG_Enumerator *enumerator )
|
|||||||
/*
|
/*
|
||||||
* Make sure we do not overwrite our precious results...
|
* Make sure we do not overwrite our precious results...
|
||||||
*/
|
*/
|
||||||
freeglut_return_if_fail( enumerator->found == FALSE );
|
if ( enumerator->found )
|
||||||
|
return;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Check the window's handle. Hope this works. Looks ugly. That's for sure.
|
* Check the window's handle. Hope this works. Looks ugly. That's for sure.
|
||||||
*/
|
*/
|
||||||
if( window->ID == (int) (enumerator->data) ) /* XXX int/ptr conversion! */
|
if( window->ID == (int) (enumerator->data) ) /* XXX int/ptr conversion! */
|
||||||
{
|
{
|
||||||
enumerator->found = TRUE;
|
enumerator->found = GL_TRUE;
|
||||||
enumerator->data = window;
|
enumerator->data = window;
|
||||||
|
|
||||||
return;
|
return;
|
||||||
@ -616,10 +618,10 @@ SFG_Window* fgWindowByID( int windowID )
|
|||||||
/*
|
/*
|
||||||
* Uses a method very similiar for fgWindowByHandle...
|
* Uses a method very similiar for fgWindowByHandle...
|
||||||
*/
|
*/
|
||||||
enumerator.found = FALSE;
|
enumerator.found = GL_FALSE;
|
||||||
enumerator.data = (void *) windowID; /* XXX int/pointer conversion! */
|
enumerator.data = (void *) windowID; /* XXX int/pointer conversion! */
|
||||||
fgEnumWindows( fghcbWindowByID, &enumerator );
|
fgEnumWindows( fghcbWindowByID, &enumerator );
|
||||||
if( enumerator.found == TRUE )
|
if( enumerator.found )
|
||||||
return( SFG_Window *) enumerator.data;
|
return( SFG_Window *) enumerator.data;
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
@ -66,7 +66,7 @@ XVisualInfo* fgChooseVisual( void )
|
|||||||
{
|
{
|
||||||
#define BUFFER_SIZES 6
|
#define BUFFER_SIZES 6
|
||||||
int bufferSize[BUFFER_SIZES] = { 16, 12, 8, 4, 2, 1 };
|
int bufferSize[BUFFER_SIZES] = { 16, 12, 8, 4, 2, 1 };
|
||||||
GLboolean wantIndexedMode = FALSE;
|
GLboolean wantIndexedMode = GL_FALSE;
|
||||||
int attributes[ 32 ];
|
int attributes[ 32 ];
|
||||||
int where = 0;
|
int where = 0;
|
||||||
|
|
||||||
@ -83,7 +83,7 @@ XVisualInfo* fgChooseVisual( void )
|
|||||||
if( fgState.DisplayMode & GLUT_INDEX )
|
if( fgState.DisplayMode & GLUT_INDEX )
|
||||||
{
|
{
|
||||||
ATTRIB_VAL( GLX_BUFFER_SIZE, 8 );
|
ATTRIB_VAL( GLX_BUFFER_SIZE, 8 );
|
||||||
wantIndexedMode = TRUE;
|
wantIndexedMode = GL_TRUE;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -121,7 +121,7 @@ XVisualInfo* fgChooseVisual( void )
|
|||||||
*/
|
*/
|
||||||
ATTRIB( None );
|
ATTRIB( None );
|
||||||
|
|
||||||
if( wantIndexedMode == FALSE )
|
if( ! wantIndexedMode )
|
||||||
return glXChooseVisual( fgDisplay.Display, fgDisplay.Screen,
|
return glXChooseVisual( fgDisplay.Display, fgDisplay.Screen,
|
||||||
attributes );
|
attributes );
|
||||||
else
|
else
|
||||||
@ -204,10 +204,10 @@ GLboolean fgSetupPixelFormat( SFG_Window* window, GLboolean checkOnly,
|
|||||||
|
|
||||||
pixelformat = ChoosePixelFormat( window->Window.Device, ppfd );
|
pixelformat = ChoosePixelFormat( window->Window.Device, ppfd );
|
||||||
if( pixelformat == 0 )
|
if( pixelformat == 0 )
|
||||||
return FALSE;
|
return GL_FALSE;
|
||||||
|
|
||||||
if( checkOnly )
|
if( checkOnly )
|
||||||
return TRUE;
|
return GL_TRUE;
|
||||||
return SetPixelFormat( window->Window.Device, pixelformat, ppfd );
|
return SetPixelFormat( window->Window.Device, pixelformat, ppfd );
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@ -249,7 +249,7 @@ void fgSetWindow ( SFG_Window *window )
|
|||||||
*/
|
*/
|
||||||
void fgOpenWindow( SFG_Window* window, const char* title,
|
void fgOpenWindow( SFG_Window* window, const char* title,
|
||||||
int x, int y, int w, int h,
|
int x, int y, int w, int h,
|
||||||
GLboolean gameMode, int isSubWindow )
|
GLboolean gameMode, GLboolean isSubWindow )
|
||||||
{
|
{
|
||||||
#if TARGET_HOST_UNIX_X11
|
#if TARGET_HOST_UNIX_X11
|
||||||
XSetWindowAttributes winAttr;
|
XSetWindowAttributes winAttr;
|
||||||
@ -370,7 +370,7 @@ void fgOpenWindow( SFG_Window* window, const char* title,
|
|||||||
NULL, fgState.ForceDirectContext | fgState.TryDirectContext
|
NULL, fgState.ForceDirectContext | fgState.TryDirectContext
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
else if ( fgState.UseCurrentContext == TRUE )
|
else if ( fgState.UseCurrentContext )
|
||||||
{
|
{
|
||||||
window->Window.Context = glXGetCurrentContext();
|
window->Window.Context = glXGetCurrentContext();
|
||||||
|
|
||||||
@ -401,12 +401,12 @@ void fgOpenWindow( SFG_Window* window, const char* title,
|
|||||||
* XXX Assume the new window is visible by default
|
* XXX Assume the new window is visible by default
|
||||||
* XXX Is this a safe assumption?
|
* XXX Is this a safe assumption?
|
||||||
*/
|
*/
|
||||||
window->State.Visible = TRUE;
|
window->State.Visible = GL_TRUE;
|
||||||
|
|
||||||
sizeHints.flags = 0;
|
sizeHints.flags = 0;
|
||||||
if (fgState.Position.Use == TRUE)
|
if ( fgState.Position.Use )
|
||||||
sizeHints.flags |= USPosition;
|
sizeHints.flags |= USPosition;
|
||||||
if (fgState.Size.Use == TRUE)
|
if ( fgState.Size.Use )
|
||||||
sizeHints.flags |= USSize;
|
sizeHints.flags |= USSize;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -423,8 +423,7 @@ void fgOpenWindow( SFG_Window* window, const char* title,
|
|||||||
sizeHints.height = h;
|
sizeHints.height = h;
|
||||||
|
|
||||||
wmHints.flags = StateHint;
|
wmHints.flags = StateHint;
|
||||||
wmHints.initial_state =
|
wmHints.initial_state = fgState.ForceIconic ? IconicState : NormalState;
|
||||||
(fgState.ForceIconic == FALSE) ? NormalState : IconicState;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Prepare the window and iconified window names...
|
* Prepare the window and iconified window names...
|
||||||
@ -460,7 +459,7 @@ void fgOpenWindow( SFG_Window* window, const char* title,
|
|||||||
atom = GetClassInfo( fgDisplay.Instance, "FREEGLUT", &wc );
|
atom = GetClassInfo( fgDisplay.Instance, "FREEGLUT", &wc );
|
||||||
assert( atom != 0 );
|
assert( atom != 0 );
|
||||||
|
|
||||||
if( gameMode != FALSE )
|
if( gameMode )
|
||||||
{
|
{
|
||||||
assert( window->Parent == NULL );
|
assert( window->Parent == NULL );
|
||||||
|
|
||||||
@ -472,7 +471,7 @@ void fgOpenWindow( SFG_Window* window, const char* title,
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if ( ( !isSubWindow ) && ( ! window->IsMenu ) )
|
if ( ( ! isSubWindow ) && ( ! window->IsMenu ) )
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* Update the window dimensions, taking account of window
|
* Update the window dimensions, taking account of window
|
||||||
@ -484,12 +483,12 @@ void fgOpenWindow( SFG_Window* window, const char* title,
|
|||||||
GetSystemMetrics( SM_CYCAPTION );
|
GetSystemMetrics( SM_CYCAPTION );
|
||||||
}
|
}
|
||||||
|
|
||||||
if( fgState.Position.Use == FALSE )
|
if( ! fgState.Position.Use )
|
||||||
{
|
{
|
||||||
x = CW_USEDEFAULT;
|
x = CW_USEDEFAULT;
|
||||||
y = CW_USEDEFAULT;
|
y = CW_USEDEFAULT;
|
||||||
}
|
}
|
||||||
if( fgState.Size.Use == FALSE )
|
if( ! fgState.Size.Use )
|
||||||
{
|
{
|
||||||
w = CW_USEDEFAULT;
|
w = CW_USEDEFAULT;
|
||||||
h = CW_USEDEFAULT;
|
h = CW_USEDEFAULT;
|
||||||
@ -574,7 +573,7 @@ void fgCloseWindow( SFG_Window* window )
|
|||||||
int FGAPIENTRY glutCreateWindow( const char* title )
|
int FGAPIENTRY glutCreateWindow( const char* title )
|
||||||
{
|
{
|
||||||
return fgCreateWindow( NULL, title, fgState.Position.X, fgState.Position.Y,
|
return fgCreateWindow( NULL, title, fgState.Position.X, fgState.Position.Y,
|
||||||
fgState.Size.X, fgState.Size.Y, FALSE )->ID;
|
fgState.Size.X, fgState.Size.Y, GL_FALSE )->ID;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -588,7 +587,7 @@ int FGAPIENTRY glutCreateSubWindow( int parentID, int x, int y, int w, int h )
|
|||||||
freeglut_assert_ready;
|
freeglut_assert_ready;
|
||||||
parent = fgWindowByID( parentID );
|
parent = fgWindowByID( parentID );
|
||||||
freeglut_return_val_if_fail( parent != NULL, 0 );
|
freeglut_return_val_if_fail( parent != NULL, 0 );
|
||||||
window = fgCreateWindow( parent, "", x, y, w, h, FALSE );
|
window = fgCreateWindow( parent, "", x, y, w, h, GL_FALSE );
|
||||||
return window->ID;
|
return window->ID;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -601,7 +600,7 @@ void FGAPIENTRY glutDestroyWindow( int windowID )
|
|||||||
freeglut_return_if_fail( window != NULL );
|
freeglut_return_if_fail( window != NULL );
|
||||||
{
|
{
|
||||||
fgExecutionState ExecState = fgState.ExecState;
|
fgExecutionState ExecState = fgState.ExecState;
|
||||||
fgAddToWindowDestroyList( window, TRUE );
|
fgAddToWindowDestroyList( window, GL_TRUE );
|
||||||
fgState.ExecState = ExecState;
|
fgState.ExecState = ExecState;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -658,7 +657,7 @@ void FGAPIENTRY glutShowWindow( void )
|
|||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
fgStructure.Window->State.Redisplay = TRUE;
|
fgStructure.Window->State.Redisplay = GL_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -684,7 +683,7 @@ void FGAPIENTRY glutHideWindow( void )
|
|||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
fgStructure.Window->State.Redisplay = FALSE;
|
fgStructure.Window->State.Redisplay = GL_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -707,7 +706,7 @@ void FGAPIENTRY glutIconifyWindow( void )
|
|||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
fgStructure.Window->State.Redisplay = FALSE;
|
fgStructure.Window->State.Redisplay = GL_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Reference in New Issue
Block a user