fgError( "Fatal error in program. NULL display callback not "
"permitted in GLUT 3.0+ or freeglut 2.0.1+\n" );
SET_CALLBACK( Display );
- fgStructure.Window->State.Redisplay = TRUE;
+ fgStructure.Window->State.Redisplay = GL_TRUE;
}
/*
{
freeglut_assert_ready;
freeglut_assert_window;
- fgStructure.Window->State.Redisplay = TRUE;
+ fgStructure.Window->State.Redisplay = GL_TRUE;
}
/*
freeglut_assert_ready;
window = fgWindowByID( windowID );
freeglut_return_if_fail( window );
- window->State.Redisplay = TRUE;
+ window->State.Redisplay = GL_TRUE;
}
/*** END OF FILE ***/
fgState.GameModeRefresh ) )
{
if( haveToTest )
- return TRUE;
+ return GL_TRUE;
/*
* OKi, this is the display mode we have been looking for...
*/
fgDisplay.Screen,
displayModes[ i ]
);
- return TRUE;
+ return GL_TRUE;
}
}
}
/*
* Something must have went wrong
*/
- return FALSE;
+ return GL_FALSE;
# else
# warning fghChangeDisplayMode: missing XFree86 video mode extensions, game mode will not change screen resolution when activated
#elif TARGET_HOST_WIN32
unsigned int displayModes = 0, mode = 0xffffffff;
- GLboolean success = FALSE;
+ GLboolean success = GL_FALSE;
/* HDC desktopDC; */
DEVMODE devMode;
* Enumerate the available display modes
* 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?
/*
* Enumerate the available display modes
*/
- while( EnumDisplaySettings( NULL, displayModes, &devMode ) == TRUE )
+ while( EnumDisplaySettings( NULL, displayModes, &devMode ) )
{
/* then try without Display Frequency */
if( fghCheckDisplayMode( devMode.dmPelsWidth,
int FGAPIENTRY glutEnterGameMode( void )
{
if( fgStructure.GameMode )
- fgAddToWindowDestroyList( fgStructure.GameMode, TRUE );
+ fgAddToWindowDestroyList( fgStructure.GameMode, GL_TRUE );
else
fghRememberState( );
- if( fghChangeDisplayMode( FALSE ) == FALSE )
+ if( ! fghChangeDisplayMode( GL_FALSE ) )
{
fgWarning( "failed to change screen settings" );
return FALSE;
fgStructure.GameMode = fgCreateWindow(
NULL, "FREEGLUT", 0, 0,
- fgState.GameModeSize.X, fgState.GameModeSize.Y, TRUE
+ fgState.GameModeSize.X, fgState.GameModeSize.Y, GL_TRUE
);
#if TARGET_HOST_UNIX_X11
{
freeglut_return_if_fail( fgStructure.GameMode );
- fgAddToWindowDestroyList( fgStructure.GameMode, TRUE );
+ fgAddToWindowDestroyList( fgStructure.GameMode, GL_TRUE );
#if TARGET_HOST_UNIX_X11
return !!fgStructure.GameMode;
case GLUT_GAME_MODE_POSSIBLE:
- return fghChangeDisplayMode( TRUE );
+ return fghChangeDisplayMode( GL_TRUE );
case GLUT_GAME_MODE_WIDTH:
return fgState.GameModeSize.X;
/*
* The settings for the current freeglut session
*/
-SFG_State fgState = { { -1, -1, FALSE }, /* Position */
- { 300, 300, TRUE }, /* Size */
+SFG_State fgState = { { -1, -1, GL_FALSE }, /* Position */
+ { 300, 300, GL_TRUE }, /* Size */
GLUT_RGBA | GLUT_SINGLE | GLUT_DEPTH, /* DisplayMode */
- FALSE, /* Initalized */
- FALSE, /* ForceDirectContext */
- TRUE, /* TryDirectContext */
- FALSE, /* ForceIconic */
- FALSE, /* UseCurrentContext */
- FALSE, /* GLDebugSwitch */
- FALSE, /* XSyncSwitch */
- TRUE, /* IgnoreKeyRepeat */
- 0, /* FPSInterval */
- 0, /* SwapCount */
- 0, /* SwapTime */
+ GL_FALSE, /* Initalized */
+ GL_FALSE, /* ForceDirectContext */
+ GL_TRUE, /* TryDirectContext */
+ GL_FALSE, /* ForceIconic */
+ GL_FALSE, /* UseCurrentContext */
+ GL_FALSE, /* GLDebugSwitch */
+ GL_FALSE, /* XSyncSwitch */
+ GL_TRUE, /* IgnoreKeyRepeat */
+ 0, /* FPSInterval */
+ 0, /* SwapCount */
+ 0, /* SwapTime */
#if TARGET_HOST_WIN32
- { 0, FALSE }, /* Time */
+ { 0, GL_FALSE }, /* Time */
#else
- { { 0, 0 }, FALSE },
+ { { 0, 0 }, GL_FALSE },
#endif
- { NULL, NULL } , /* Timers */
- NULL, /* IdleCallback */
- FALSE, /* BuildingAMenu */
- 0, /* ActiveMenus */
- NULL, /* MenuStateCallback */
- NULL, /* MenuStatusCallback */
- { 640, 480, TRUE }, /* GameModeSize */
- 16, /* GameModeDepth */
- 72, /* GameModeRefresh */
- GLUT_ACTION_EXIT, /* ActionOnWindowClose */
- GLUT_EXEC_STATE_INIT /* ExecState */
+ { NULL, NULL }, /* Timers */
+ NULL, /* IdleCallback */
+ GL_FALSE, /* BuildingAMenu */
+ 0, /* ActiveMenus */
+ NULL, /* MenuStateCallback */
+ NULL, /* MenuStatusCallback */
+ { 640, 480, GL_TRUE }, /* GameModeSize */
+ 16, /* GameModeDepth */
+ 72, /* GameModeRefresh */
+ GLUT_ACTION_EXIT, /* ActionOnWindowClose */
+ GLUT_EXEC_STATE_INIT /* ExecState */
} ;
fgState.Position.X = -1;
fgState.Position.Y = -1;
- fgState.Position.Use = FALSE;
+ fgState.Position.Use = GL_FALSE;
fgState.Size.X = 300;
fgState.Size.Y = 300;
- fgState.Size.Use = TRUE;
+ fgState.Size.Use = GL_TRUE;
fgState.DisplayMode = GLUT_RGBA | GLUT_SINGLE | GLUT_DEPTH;
- fgState.ForceDirectContext = FALSE;
- fgState.TryDirectContext = TRUE;
- fgState.ForceIconic = FALSE;
- fgState.UseCurrentContext = FALSE;
- fgState.GLDebugSwitch = FALSE;
- fgState.XSyncSwitch = FALSE;
+ fgState.ForceDirectContext = GL_FALSE;
+ fgState.TryDirectContext = GL_TRUE;
+ fgState.ForceIconic = GL_FALSE;
+ fgState.UseCurrentContext = GL_FALSE;
+ fgState.GLDebugSwitch = GL_FALSE;
+ fgState.XSyncSwitch = GL_FALSE;
fgState.ActionOnWindowClose = GLUT_ACTION_EXIT ;
fgState.ExecState = GLUT_EXEC_STATE_INIT ;
- fgState.IgnoreKeyRepeat = TRUE;
+ fgState.IgnoreKeyRepeat = GL_TRUE;
fgState.GameModeSize.X = 640;
fgState.GameModeSize.Y = 480;
fgState.GameModeDepth = 16;
fgState.GameModeRefresh = 72;
- fgState.Time.Set = FALSE;
+ fgState.Time.Set = GL_FALSE;
fgState.Timers.First = fgState.Timers.Last = NULL;
fgState.IdleCallback = NULL;
}
else if( strcmp( argv[ i ], "-direct" ) == 0)
{
- if( fgState.TryDirectContext == FALSE )
+ if( ! fgState.TryDirectContext )
fgError( "parameters ambiguity, -direct and -indirect "
"cannot be both specified" );
- fgState.ForceDirectContext = TRUE;
+ fgState.ForceDirectContext = GL_TRUE;
argv[ i ] = NULL;
( *pargc )--;
}
else if( strcmp( argv[ i ], "-indirect" ) == 0 )
{
- if( fgState.ForceDirectContext == TRUE )
+ if( fgState.ForceDirectContext )
fgError( "parameters ambiguity, -direct and -indirect "
"cannot be both specified" );
- fgState.TryDirectContext = FALSE;
+ fgState.TryDirectContext = GL_FALSE;
argv[ i ] = NULL;
(*pargc)--;
}
else if( strcmp( argv[ i ], "-iconic" ) == 0 )
{
- fgState.ForceIconic = TRUE;
+ fgState.ForceIconic = GL_TRUE;
argv[ i ] = NULL;
( *pargc )--;
}
else if( strcmp( argv[ i ], "-gldebug" ) == 0 )
{
- fgState.GLDebugSwitch = TRUE;
+ fgState.GLDebugSwitch = GL_TRUE;
argv[ i ] = NULL;
( *pargc )--;
}
else if( strcmp( argv[ i ], "-sync" ) == 0 )
{
- fgState.XSyncSwitch = TRUE;
+ fgState.XSyncSwitch = GL_TRUE;
argv[ i ] = NULL;
( *pargc )--;
}
* Check for the minus one settings for both position and size...
*/
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 )
- fgState.Size.Use = FALSE;
+ fgState.Size.Use = GL_FALSE;
if( displayName )
free( displayName );
{
if( ( x >= 0 ) && ( y >= 0 ) )
{
- fgState.Position.X = x;
- fgState.Position.Y = y;
- fgState.Position.Use = TRUE;
+ fgState.Position.X = x;
+ fgState.Position.Y = y;
+ fgState.Position.Use = GL_TRUE;
}
else
{
- fgState.Position.X = -1;
- fgState.Position.Y = -1;
- fgState.Position.Use = FALSE;
+ fgState.Position.X = -1;
+ fgState.Position.Y = -1;
+ fgState.Position.Use = GL_FALSE;
}
}
{
if( ( width > 0 ) && ( height > 0 ) )
{
- fgState.Size.X = width;
- fgState.Size.Y = height;
- fgState.Size.Use = TRUE;
+ fgState.Size.X = width;
+ fgState.Size.Y = height;
+ fgState.Size.Use = GL_TRUE;
}
else
{
- fgState.Size.X = -1;
- fgState.Size.Y = -1;
- fgState.Size.Use = FALSE;
+ fgState.Size.X = -1;
+ fgState.Size.Y = -1;
+ fgState.Size.Use = GL_FALSE;
}
}
void fgSetWindow ( SFG_Window *window );
void fgOpenWindow( SFG_Window* window, const char* title,
int x, int y, int w, int h, GLboolean gameMode,
- int isSubWindow );
+ GLboolean isSubWindow );
void fgCloseWindow( SFG_Window* window );
void fgAddToWindowDestroyList ( SFG_Window* window,
GLboolean needToClose );
if( status != JOYERR_NOERROR )
{
- joy->error = TRUE;
+ joy->error = GL_TRUE;
return;
}
}
fgWarning( "%s", joy->fname );
- joy->error = TRUE;
+ joy->error = GL_TRUE;
return;
}
if( status != JS_RETURN )
{
fgWarning( "%s", joy->fname );
- joy->error = TRUE;
+ joy->error = GL_TRUE;
return;
}
* I guess we have no axes at all
*/
default:
- joy->error = TRUE;
+ joy->error = GL_TRUE;
break;
}
joy->center[ 1 ] == 512.0f );
if( counter >= 100 )
- joy->error = TRUE;
+ joy->error = GL_TRUE;
# endif
for( i = 0; i < _JS_MAX_AXES; i++ )
break;
default:
fgJoystick->num_axes = 0;
- fgJoystick->error = TRUE;
+ fgJoystick->error = GL_TRUE;
break;
}
#else
fgError( "illegal attempt to deinitialize joystick device" );
#ifndef WIN32
- if( fgJoystick->error != TRUE )
+ if( ! fgJoystick->error )
close( fgJoystick->fd );
#endif
* XXX the {window} pointer is defined.
*/
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, ( ) );
}
* But without this we get this bad behaviour whenever we resize the
* window.
*/
- window->State.Redisplay = TRUE;
+ window->State.Redisplay = GL_TRUE;
if( window->IsMenu )
fgSetWindow( current_window );
* XXX loop if you didn't have a display callback defined...
*/
if( ( FETCH_WCB( *window, Display ) ) &&
- ( window->State.Redisplay == TRUE ) &&
- ( window->State.Visible == TRUE ) )
+ window->State.Redisplay &&
+ window->State.Visible )
{
SFG_Window *current_window = fgStructure.Window;
- window->State.Redisplay = FALSE;
+ window->State.Redisplay = GL_FALSE;
INVOKE_WCB( *window, Display, ( ) );
fgSetWindow( current_window );
}
glutGet( GLUT_WINDOW_HEIGHT )
);
- window->State.NeedToResize = FALSE;
+ window->State.NeedToResize = GL_FALSE;
fgSetWindow ( current_window );
}
* XXX See above comment about the Redisplay flag...
*/
if( ( FETCH_WCB( *window, Display ) ) &&
- ( window->State.Redisplay == TRUE ) &&
- ( window->State.Visible == TRUE ) )
+ window->State.Redisplay &&
+ window->State.Visible )
{
- window->State.Redisplay = FALSE;
+ window->State.Redisplay = GL_FALSE;
RedrawWindow(
window->Window.Handle, NULL, NULL,
{
SFG_Enumerator enumerator;
- enumerator.found = FALSE;
- enumerator.data = NULL;
+ enumerator.found = GL_FALSE;
+ enumerator.data = NULL;
fgEnumWindows( fghcbDisplayWindow, &enumerator );
}
{
SFG_Enumerator enumerator;
- enumerator.found = FALSE;
- enumerator.data = NULL;
+ enumerator.found = GL_FALSE;
+ enumerator.data = NULL;
fgEnumWindows( fghcbCheckJoystickPolls, &enumerator );
}
#elif TARGET_HOST_WIN32
fgState.Time.Value = timeGetTime( );
#endif
- fgState.Time.Set = TRUE;
+ fgState.Time.Set = GL_TRUE;
}
}
{
if( FETCH_WCB( *w, Joystick ) )
{
- e->found = TRUE;
+ e->found = GL_TRUE;
e->data = w;
}
fgEnumSubWindows( w, fgCheckJoystickCallback, e );
static int fgHaveJoystick( void )
{
SFG_Enumerator enumerator;
- enumerator.found = FALSE;
+ enumerator.found = GL_FALSE;
enumerator.data = NULL;
fgEnumWindows( fgCheckJoystickCallback, &enumerator );
return !!enumerator.data;
{
if( w->State.Redisplay )
{
- e->found = TRUE;
+ e->found = GL_TRUE;
e->data = w;
}
fgEnumSubWindows( w, fgHavePendingRedisplaysCallback, e );
static int fgHavePendingRedisplays( void )
{
SFG_Enumerator enumerator;
- enumerator.found = FALSE;
+ enumerator.found = GL_FALSE;
enumerator.data = NULL;
fgEnumWindows( fgHavePendingRedisplaysCallback, &enumerator );
return !!enumerator.data;
GETWINDOW( xclient );
fgCloseWindow ( window );
- fgAddToWindowDestroyList ( window, FALSE );
+ fgAddToWindowDestroyList ( window, GL_FALSE );
}
break;
* This is sent to confirm the XDestroyWindow call.
* XXX WHY is this commented out? Should we re-enable it?
*/
- /* fgAddToWindowDestroyList ( window, FALSE ); */
+ /* fgAddToWindowDestroyList ( window, GL_FALSE ); */
break;
case Expose:
{
case VisibilityUnobscured:
INVOKE_WCB( *window, WindowStatus, ( GLUT_FULLY_RETAINED ) );
- window->State.Visible = TRUE;
+ window->State.Visible = GL_TRUE;
break;
case VisibilityPartiallyObscured:
INVOKE_WCB( *window, WindowStatus,
( GLUT_PARTIALLY_RETAINED ) );
- window->State.Visible = TRUE;
+ window->State.Visible = GL_TRUE;
break;
case VisibilityFullyObscured:
INVOKE_WCB( *window, WindowStatus, ( GLUT_FULLY_COVERED ) );
- window->State.Visible = FALSE;
+ window->State.Visible = GL_FALSE;
break;
default:
window->ActiveMenu->Window->State.MouseY =
event.xmotion.y_root - window->ActiveMenu->Y;
}
- window->ActiveMenu->Window->State.Redisplay = TRUE;
+ window->ActiveMenu->Window->State.Redisplay = GL_TRUE;
fgSetWindow( window->ActiveMenu->ParentWindow );
break;
case ButtonRelease:
case ButtonPress:
{
- GLboolean pressed = TRUE;
+ GLboolean pressed = GL_TRUE;
int button;
if( event.type == ButtonRelease )
- pressed = FALSE;
+ pressed = GL_FALSE;
/*
* A mouse button has been pressed or released. Traditionally,
/* In the menu, invoke the callback and deactivate the menu*/
if( fgCheckActiveMenu( window->ActiveMenu->Window,
- window->ActiveMenu ) == TRUE )
+ window->ActiveMenu ) )
{
/*
* Save the current window and menu and set the current
*/
fgDeactivateMenu( window->ActiveMenu->ParentWindow );
- window->State.Redisplay = TRUE;
+ window->State.Redisplay = GL_TRUE;
break;
}
( window->Menu[ button ] ) &&
pressed )
{
- window->State.Redisplay = TRUE;
+ window->State.Redisplay = GL_TRUE;
fgSetWindow( window );
fgActivateMenu( window, button );
break;
{
unsigned int current_DisplayMode = fgState.DisplayMode;
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;
if( fgStructure.MenuContext )
}
else
{
- fgSetupPixelFormat( window, FALSE, PFD_MAIN_PLANE );
+ fgSetupPixelFormat( window, GL_FALSE, PFD_MAIN_PLANE );
- if( fgState.UseCurrentContext != TRUE )
+ if( ! fgState.UseCurrentContext )
window->Window.Context =
wglCreateContext( window->Window.Device );
else
}
}
- window->State.NeedToResize = TRUE;
+ window->State.NeedToResize = GL_TRUE;
ReleaseDC( window->Window.Handle, window->Window.Device );
break;
break;
case WM_SHOWWINDOW:
- window->State.Visible = TRUE;
- window->State.Redisplay = TRUE;
+ window->State.Visible = GL_TRUE;
+ window->State.Redisplay = GL_TRUE;
break;
case WM_PAINT:
* Put on a linked list of windows to be removed after all the
* callbacks have returned
*/
- fgAddToWindowDestroyList( window, FALSE );
+ fgAddToWindowDestroyList( window, GL_FALSE );
DestroyWindow( hWnd );
break;
if ( window->ActiveMenu )
{
- window->State.Redisplay = TRUE;
+ window->State.Redisplay = GL_TRUE;
fgSetWindow ( window->ActiveMenu->ParentWindow );
break;
}
case WM_MBUTTONUP:
case WM_RBUTTONUP:
{
- GLboolean pressed = TRUE;
+ GLboolean pressed = GL_TRUE;
int button;
window->State.MouseX = LOWORD( lParam );
/*
* XXX Either these multi-statement lines should be broken
* XXX in the form:
- * XXX pressed = TRUE;
+ * XXX pressed = GL_TRUE;
* XXX button = GLUT_LEFT_BUTTON;
* XXX break;
* XXX ...or we should use a macro (much as I dislike freeglut's
switch( uMsg )
{
case WM_LBUTTONDOWN:
- pressed = TRUE; button = GLUT_LEFT_BUTTON; break;
+ pressed = GL_TRUE; button = GLUT_LEFT_BUTTON; break;
case WM_MBUTTONDOWN:
- pressed = TRUE; button = GLUT_MIDDLE_BUTTON; break;
+ pressed = GL_TRUE; button = GLUT_MIDDLE_BUTTON; break;
case WM_RBUTTONDOWN:
- pressed = TRUE; button = GLUT_RIGHT_BUTTON; break;
+ pressed = GL_TRUE; button = GLUT_RIGHT_BUTTON; break;
case WM_LBUTTONUP:
- pressed = FALSE; button = GLUT_LEFT_BUTTON; break;
+ pressed = GL_FALSE; button = GLUT_LEFT_BUTTON; break;
case WM_MBUTTONUP:
- pressed = FALSE; button = GLUT_MIDDLE_BUTTON; break;
+ pressed = GL_FALSE; button = GLUT_MIDDLE_BUTTON; break;
case WM_RBUTTONUP:
- pressed = FALSE; button = GLUT_RIGHT_BUTTON; break;
+ pressed = GL_FALSE; button = GLUT_RIGHT_BUTTON; break;
default:
- pressed = FALSE; button = -1; break;
+ pressed = GL_FALSE; button = -1; break;
}
if( GetSystemMetrics( SM_SWAPBUTTON ) )
if( window->ActiveMenu )
{
/* 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 );
}
else /* In menu, invoke the callback and deactivate the menu*/
* click and menu activity.
*/
if( ! window->IsMenu )
- window->State.Redisplay = TRUE;
+ window->State.Redisplay = GL_TRUE;
break;
}
- if( ( window->Menu[ button ] ) && ( pressed == TRUE ) )
+ if ( window->Menu[ button ] && pressed )
{
- window->State.Redisplay = TRUE;
+ window->State.Redisplay = GL_TRUE;
fgSetWindow( window );
fgActivateMenu( window, button );
INVOKE_WCB(
*window, Mouse,
( button,
- pressed == TRUE ? GLUT_DOWN : GLUT_UP,
+ pressed ? GLUT_DOWN : GLUT_UP,
window->State.MouseX,
window->State.MouseY
)
case WM_SYNCPAINT: /* 0x0088 */
/* Another window has moved, need to update this one */
- window->State.Redisplay = TRUE;
+ window->State.Redisplay = GL_TRUE;
lRet = DefWindowProc( hWnd, uMsg, wParam, lParam );
/* Help screen says this message must be passed to "DefWindowProc" */
break;
menuEntry;
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
* Reactivate the submenu as the checkMenuStatus may have turned
* it off if the mouse is in its parent menu entry.
*/
- menuEntry->SubMenu->IsActive = TRUE;
- if ( return_status == TRUE )
- return TRUE;
+ menuEntry->SubMenu->IsActive = GL_TRUE;
+ if ( return_status )
+ return GL_TRUE;
}
}
for( menuEntry = (SFG_MenuEntry *)menu->Entries.First;
menuEntry;
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
menuEntry = fghFindMenuEntry( menu, menuID + 1 );
assert( menuEntry );
- menuEntry->IsActive = TRUE;
+ menuEntry->IsActive = GL_TRUE;
menuEntry->Ordinal = menuID;
/*
fgDeactivateSubMenu( menu->ActiveEntry );
menu->ActiveEntry = menuEntry;
- menu->IsActive = TRUE;
+ menu->IsActive = GL_TRUE;
/*
* OKi, we have marked that entry as active, but it would be also
/*
* Set up the initial menu position now...
*/
- menuEntry->SubMenu->IsActive = TRUE;
+ menuEntry->SubMenu->IsActive = GL_TRUE;
/*
* Set up the initial submenu position now:
/*
* 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
*/
- return TRUE;
+ return GL_TRUE;
}
/*
* Looks like the menu cursor is somewhere else...
*/
- return FALSE;
+ return GL_FALSE;
}
/*
/*
* 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.
/*
* 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:
* Mark the menu as active, so that it gets displayed:
*/
window->ActiveMenu = menu;
- menu->IsActive = TRUE;
+ menu->IsActive = GL_TRUE;
fgState.ActiveMenus++;
/*
menuEntry;
menuEntry = (SFG_MenuEntry *)menuEntry->Node.Next)
{
- if( menuEntry->IsActive == TRUE )
+ if( menuEntry->IsActive )
{
if( menuEntry->SubMenu )
fgExecuteMenuCallback( menuEntry->SubMenu );
*/
menu->Window->ActiveMenu = NULL;
menu->ParentWindow->ActiveMenu = NULL;
- menu->IsActive = FALSE;
+ menu->IsActive = GL_FALSE;
fgState.ActiveMenus--;
* Forget about having that menu active anymore, now:
*/
menuEntry->SubMenu->Window->ActiveMenu = NULL;
- menuEntry->SubMenu->IsActive = FALSE;
+ menuEntry->SubMenu->IsActive = GL_FALSE;
/*
* Hide all submenu windows, and the root menu's window.
*/
void FGAPIENTRY glutIgnoreKeyRepeat( int ignore )
{
- fgState.IgnoreKeyRepeat = ignore ? TRUE : FALSE;
+ fgState.IgnoreKeyRepeat = ignore ? GL_TRUE : GL_FALSE;
}
/*
case GLUT_RENDERING_CONTEXT:
fgState.UseCurrentContext =
- ( value == GLUT_USE_CURRENT_CONTEXT ) ? TRUE : FALSE;
+ ( value == GLUT_USE_CURRENT_CONTEXT ) ? GL_TRUE : GL_FALSE;
break;
case GLUT_WINDOW_CURSOR:
return ( GetSystemMetrics( SM_CYCAPTION ) ) ;
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:
if( fgStructure.Window != NULL )
#elif TARGET_HOST_WIN32
case GLUT_OVERLAY_POSSIBLE:
-/* return( fgSetupPixelFormat( fgStructure.Window, TRUE, PFD_OVERLAY_PLANE ) ); */
+/* return( fgSetupPixelFormat( fgStructure.Window, GL_TRUE,
+ PFD_OVERLAY_PLANE ) ); */
return FALSE ;
case GLUT_LAYER_IN_USE:
* dependant, and resides in freeglut_window.c. Uses fgState.
*/
fgOpenWindow( window, title, x, y, w, h, gameMode,
- (parent != NULL) ? TRUE : FALSE );
+ parent ? GL_TRUE : GL_FALSE );
return window;
}
* global variable BuildingAMenu to true so we can ensure
* 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;
glutDisplayFunc( fgDisplayMenu );
* While BuildingAMenu is true, all windows built have no decorations.
* 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 */
fgSetWindow( current_window );
}
fgClearCallBacks( window );
- if( needToClose == TRUE )
+ if( needToClose )
fgCloseWindow( window );
free( window );
if( fgStructure.Window == window )
if( fgStructure.Window == menu->Window )
fgSetWindow( menu->ParentWindow );
- fgDestroyWindow( menu->Window, TRUE );
+ fgDestroyWindow( menu->Window, GL_TRUE );
fgListRemove( &fgStructure.Menus, &menu->Node );
if( fgStructure.Menu == menu )
fgStructure.Menu = NULL;
fgDestroyMenu( menu );
while( window = ( SFG_Window * )fgStructure.Windows.First )
- fgDestroyWindow( window, TRUE );
+ fgDestroyWindow( window, GL_TRUE );
}
/*
window = ( SFG_Window * )window->Node.Next )
{
enumCallback( window, enumerator );
- if( enumerator->found == TRUE )
+ if( enumerator->found )
return;
}
}
child = ( SFG_Window * )child->Node.Next )
{
enumCallback( child, enumerator );
- if( enumerator->found == TRUE )
+ if( enumerator->found )
return;
}
}
static void fghcbWindowByHandle( SFG_Window *window,
SFG_Enumerator *enumerator )
{
- freeglut_return_if_fail( enumerator->found == FALSE );
+ if ( enumerator->found )
+ return;
#if TARGET_HOST_UNIX_X11
#define WBHANDLE (Window)
*/
if( window->Window.Handle == WBHANDLE (enumerator->data) )
{
- enumerator->found = TRUE;
+ enumerator->found = GL_TRUE;
enumerator->data = window;
return;
/*
* This is easy and makes use of the windows enumeration defined above
*/
- enumerator.found = FALSE;
+ enumerator.found = GL_FALSE;
enumerator.data = (void *)hWindow;
fgEnumWindows( fghcbWindowByHandle, &enumerator );
- if( enumerator.found == TRUE )
+ if( enumerator.found )
return( SFG_Window *) enumerator.data;
return NULL;
}
/*
* 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.
*/
if( window->ID == (int) (enumerator->data) ) /* XXX int/ptr conversion! */
{
- enumerator->found = TRUE;
+ enumerator->found = GL_TRUE;
enumerator->data = window;
return;
/*
* Uses a method very similiar for fgWindowByHandle...
*/
- enumerator.found = FALSE;
+ enumerator.found = GL_FALSE;
enumerator.data = (void *) windowID; /* XXX int/pointer conversion! */
fgEnumWindows( fghcbWindowByID, &enumerator );
- if( enumerator.found == TRUE )
+ if( enumerator.found )
return( SFG_Window *) enumerator.data;
return NULL;
}
{
#define BUFFER_SIZES 6
int bufferSize[BUFFER_SIZES] = { 16, 12, 8, 4, 2, 1 };
- GLboolean wantIndexedMode = FALSE;
+ GLboolean wantIndexedMode = GL_FALSE;
int attributes[ 32 ];
int where = 0;
if( fgState.DisplayMode & GLUT_INDEX )
{
ATTRIB_VAL( GLX_BUFFER_SIZE, 8 );
- wantIndexedMode = TRUE;
+ wantIndexedMode = GL_TRUE;
}
else
{
*/
ATTRIB( None );
- if( wantIndexedMode == FALSE )
+ if( ! wantIndexedMode )
return glXChooseVisual( fgDisplay.Display, fgDisplay.Screen,
attributes );
else
pixelformat = ChoosePixelFormat( window->Window.Device, ppfd );
if( pixelformat == 0 )
- return FALSE;
+ return GL_FALSE;
if( checkOnly )
- return TRUE;
+ return GL_TRUE;
return SetPixelFormat( window->Window.Device, pixelformat, ppfd );
}
#endif
*/
void fgOpenWindow( SFG_Window* window, const char* title,
int x, int y, int w, int h,
- GLboolean gameMode, int isSubWindow )
+ GLboolean gameMode, GLboolean isSubWindow )
{
#if TARGET_HOST_UNIX_X11
XSetWindowAttributes winAttr;
NULL, fgState.ForceDirectContext | fgState.TryDirectContext
);
}
- else if ( fgState.UseCurrentContext == TRUE )
+ else if ( fgState.UseCurrentContext )
{
window->Window.Context = glXGetCurrentContext();
* XXX Assume the new window is visible by default
* XXX Is this a safe assumption?
*/
- window->State.Visible = TRUE;
+ window->State.Visible = GL_TRUE;
sizeHints.flags = 0;
- if (fgState.Position.Use == TRUE)
+ if ( fgState.Position.Use )
sizeHints.flags |= USPosition;
- if (fgState.Size.Use == TRUE)
+ if ( fgState.Size.Use )
sizeHints.flags |= USSize;
/*
sizeHints.height = h;
wmHints.flags = StateHint;
- wmHints.initial_state =
- (fgState.ForceIconic == FALSE) ? NormalState : IconicState;
+ wmHints.initial_state = fgState.ForceIconic ? IconicState : NormalState;
/*
* Prepare the window and iconified window names...
atom = GetClassInfo( fgDisplay.Instance, "FREEGLUT", &wc );
assert( atom != 0 );
- if( gameMode != FALSE )
+ if( gameMode )
{
assert( window->Parent == NULL );
}
else
{
- if ( ( !isSubWindow ) && ( ! window->IsMenu ) )
+ if ( ( ! isSubWindow ) && ( ! window->IsMenu ) )
{
/*
* Update the window dimensions, taking account of window
GetSystemMetrics( SM_CYCAPTION );
}
- if( fgState.Position.Use == FALSE )
+ if( ! fgState.Position.Use )
{
x = CW_USEDEFAULT;
y = CW_USEDEFAULT;
}
- if( fgState.Size.Use == FALSE )
+ if( ! fgState.Size.Use )
{
w = CW_USEDEFAULT;
h = CW_USEDEFAULT;
int FGAPIENTRY glutCreateWindow( const char* title )
{
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;
}
/*
freeglut_assert_ready;
parent = fgWindowByID( parentID );
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;
}
freeglut_return_if_fail( window != NULL );
{
fgExecutionState ExecState = fgState.ExecState;
- fgAddToWindowDestroyList( window, TRUE );
+ fgAddToWindowDestroyList( window, GL_TRUE );
fgState.ExecState = ExecState;
}
}
#endif
- fgStructure.Window->State.Redisplay = TRUE;
+ fgStructure.Window->State.Redisplay = GL_TRUE;
}
/*
#endif
- fgStructure.Window->State.Redisplay = FALSE;
+ fgStructure.Window->State.Redisplay = GL_FALSE;
}
/*
#endif
- fgStructure.Window->State.Redisplay = FALSE;
+ fgStructure.Window->State.Redisplay = GL_FALSE;
}
/*