Last of the hard TABs in the src/*.c files.

git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@282 7f0cb862-5218-0410-a997-914c9d46530a
This commit is contained in:
rkrolib 2003-10-31 13:40:08 +00:00
parent c89d0c24d9
commit 02e53500a7
4 changed files with 129 additions and 129 deletions

View File

@ -75,44 +75,44 @@ void FGAPIENTRY glutSetCursor( int cursorID )
* Print a warning message? * Print a warning message?
*/ */
{ {
Cursor cursor; Cursor cursor;
#define MAP_CURSOR(a,b) case a: cursor = XCreateFontCursor( fgDisplay.Display, b ); break; #define MAP_CURSOR(a,b) case a: cursor = XCreateFontCursor( fgDisplay.Display, b ); break;
if( GLUT_CURSOR_FULL_CROSSHAIR == cursorID ) if( GLUT_CURSOR_FULL_CROSSHAIR == cursorID )
cursorID = GLUT_CURSOR_CROSSHAIR; cursorID = GLUT_CURSOR_CROSSHAIR;
switch( cursorID ) switch( cursorID )
{ {
MAP_CURSOR( GLUT_CURSOR_RIGHT_ARROW, XC_right_ptr); MAP_CURSOR( GLUT_CURSOR_RIGHT_ARROW, XC_right_ptr);
MAP_CURSOR( GLUT_CURSOR_LEFT_ARROW, XC_left_ptr); MAP_CURSOR( GLUT_CURSOR_LEFT_ARROW, XC_left_ptr);
MAP_CURSOR( GLUT_CURSOR_INFO, XC_hand1); MAP_CURSOR( GLUT_CURSOR_INFO, XC_hand1);
MAP_CURSOR( GLUT_CURSOR_DESTROY, XC_pirate); MAP_CURSOR( GLUT_CURSOR_DESTROY, XC_pirate);
MAP_CURSOR( GLUT_CURSOR_HELP, XC_question_arrow); MAP_CURSOR( GLUT_CURSOR_HELP, XC_question_arrow);
MAP_CURSOR( GLUT_CURSOR_CYCLE, XC_exchange); MAP_CURSOR( GLUT_CURSOR_CYCLE, XC_exchange);
MAP_CURSOR( GLUT_CURSOR_SPRAY, XC_spraycan); MAP_CURSOR( GLUT_CURSOR_SPRAY, XC_spraycan);
MAP_CURSOR( GLUT_CURSOR_WAIT, XC_watch); MAP_CURSOR( GLUT_CURSOR_WAIT, XC_watch);
MAP_CURSOR( GLUT_CURSOR_TEXT, XC_xterm); MAP_CURSOR( GLUT_CURSOR_TEXT, XC_xterm);
MAP_CURSOR( GLUT_CURSOR_CROSSHAIR, XC_crosshair); MAP_CURSOR( GLUT_CURSOR_CROSSHAIR, XC_crosshair);
MAP_CURSOR( GLUT_CURSOR_UP_DOWN, XC_sb_v_double_arrow); MAP_CURSOR( GLUT_CURSOR_UP_DOWN, XC_sb_v_double_arrow);
MAP_CURSOR( GLUT_CURSOR_LEFT_RIGHT, XC_sb_h_double_arrow); MAP_CURSOR( GLUT_CURSOR_LEFT_RIGHT, XC_sb_h_double_arrow);
MAP_CURSOR( GLUT_CURSOR_TOP_SIDE, XC_top_side); MAP_CURSOR( GLUT_CURSOR_TOP_SIDE, XC_top_side);
MAP_CURSOR( GLUT_CURSOR_BOTTOM_SIDE, XC_bottom_side); MAP_CURSOR( GLUT_CURSOR_BOTTOM_SIDE, XC_bottom_side);
MAP_CURSOR( GLUT_CURSOR_LEFT_SIDE, XC_left_side); MAP_CURSOR( GLUT_CURSOR_LEFT_SIDE, XC_left_side);
MAP_CURSOR( GLUT_CURSOR_RIGHT_SIDE, XC_right_side); MAP_CURSOR( GLUT_CURSOR_RIGHT_SIDE, XC_right_side);
MAP_CURSOR( GLUT_CURSOR_TOP_LEFT_CORNER, XC_top_left_corner); MAP_CURSOR( GLUT_CURSOR_TOP_LEFT_CORNER, XC_top_left_corner);
MAP_CURSOR( GLUT_CURSOR_TOP_RIGHT_CORNER, XC_top_right_corner); MAP_CURSOR( GLUT_CURSOR_TOP_RIGHT_CORNER, XC_top_right_corner);
MAP_CURSOR( GLUT_CURSOR_BOTTOM_RIGHT_CORNER, XC_bottom_right_corner); MAP_CURSOR( GLUT_CURSOR_BOTTOM_RIGHT_CORNER, XC_bottom_right_corner);
MAP_CURSOR( GLUT_CURSOR_BOTTOM_LEFT_CORNER, XC_bottom_left_corner); MAP_CURSOR( GLUT_CURSOR_BOTTOM_LEFT_CORNER, XC_bottom_left_corner);
MAP_CURSOR( GLUT_CURSOR_NONE, XC_bogosity); MAP_CURSOR( GLUT_CURSOR_NONE, XC_bogosity);
case GLUT_CURSOR_INHERIT: case GLUT_CURSOR_INHERIT:
break; break;
default: default:
return; return;
} }
if( GLUT_CURSOR_INHERIT == cursorID ) if( GLUT_CURSOR_INHERIT == cursorID )
XUndefineCursor( fgDisplay.Display, fgStructure.Window->Window.Handle ); XUndefineCursor( fgDisplay.Display, fgStructure.Window->Window.Handle );
else else
XDefineCursor( fgDisplay.Display, fgStructure.Window->Window.Handle, cursor ); XDefineCursor( fgDisplay.Display, fgStructure.Window->Window.Handle, cursor );
} }
#elif TARGET_HOST_WIN32 #elif TARGET_HOST_WIN32
@ -121,32 +121,32 @@ void FGAPIENTRY glutSetCursor( int cursorID )
* This is a temporary solution only... * This is a temporary solution only...
*/ */
/* Set the cursor AND change it for this window class. */ /* Set the cursor AND change it for this window class. */
# define MAP_CURSOR(a,b) case a: SetCursor( LoadCursor( NULL, b ) ); \ # define MAP_CURSOR(a,b) case a: SetCursor( LoadCursor( NULL, b ) ); \
SetClassLong(fgStructure.Window->Window.Handle,GCL_HCURSOR,(LONG)LoadCursor(NULL,b)); \ SetClassLong(fgStructure.Window->Window.Handle,GCL_HCURSOR,(LONG)LoadCursor(NULL,b)); \
break; break;
/* Nuke the cursor AND change it for this window class. */ /* Nuke the cursor AND change it for this window class. */
# define ZAP_CURSOR(a,b) case a: SetCursor( NULL ); \ # define ZAP_CURSOR(a,b) case a: SetCursor( NULL ); \
SetClassLong(fgStructure.Window->Window.Handle,GCL_HCURSOR,(LONG)NULL); \ SetClassLong(fgStructure.Window->Window.Handle,GCL_HCURSOR,(LONG)NULL); \
break; break;
switch( cursorID ) switch( cursorID )
{ {
MAP_CURSOR( GLUT_CURSOR_RIGHT_ARROW, IDC_ARROW ); MAP_CURSOR( GLUT_CURSOR_RIGHT_ARROW, IDC_ARROW );
MAP_CURSOR( GLUT_CURSOR_LEFT_ARROW, IDC_ARROW ); MAP_CURSOR( GLUT_CURSOR_LEFT_ARROW, IDC_ARROW );
MAP_CURSOR( GLUT_CURSOR_INFO, IDC_HELP ); MAP_CURSOR( GLUT_CURSOR_INFO, IDC_HELP );
MAP_CURSOR( GLUT_CURSOR_DESTROY, IDC_CROSS ); MAP_CURSOR( GLUT_CURSOR_DESTROY, IDC_CROSS );
MAP_CURSOR( GLUT_CURSOR_HELP, IDC_HELP ); MAP_CURSOR( GLUT_CURSOR_HELP, IDC_HELP );
MAP_CURSOR( GLUT_CURSOR_CYCLE, IDC_SIZEALL ); MAP_CURSOR( GLUT_CURSOR_CYCLE, IDC_SIZEALL );
MAP_CURSOR( GLUT_CURSOR_SPRAY, IDC_CROSS ); MAP_CURSOR( GLUT_CURSOR_SPRAY, IDC_CROSS );
MAP_CURSOR( GLUT_CURSOR_WAIT, IDC_WAIT ); MAP_CURSOR( GLUT_CURSOR_WAIT, IDC_WAIT );
MAP_CURSOR( GLUT_CURSOR_TEXT, IDC_UPARROW ); MAP_CURSOR( GLUT_CURSOR_TEXT, IDC_UPARROW );
MAP_CURSOR( GLUT_CURSOR_CROSSHAIR, IDC_CROSS ); MAP_CURSOR( GLUT_CURSOR_CROSSHAIR, IDC_CROSS );
/* MAP_CURSOR( GLUT_CURSOR_NONE, IDC_NO ); */ /* MAP_CURSOR( GLUT_CURSOR_NONE, IDC_NO ); */
ZAP_CURSOR( GLUT_CURSOR_NONE, NULL ); ZAP_CURSOR( GLUT_CURSOR_NONE, NULL );
default: default:
MAP_CURSOR( GLUT_CURSOR_UP_DOWN, IDC_ARROW ); MAP_CURSOR( GLUT_CURSOR_UP_DOWN, IDC_ARROW );
} }
#endif #endif
fgStructure.Window->State.Cursor = cursorID; fgStructure.Window->State.Cursor = cursorID;

View File

@ -57,7 +57,7 @@ void FGAPIENTRY glutSwapBuffers( void )
glFlush(); glFlush();
if ( ! fgStructure.Window->Window.DoubleBuffered ) if ( ! fgStructure.Window->Window.DoubleBuffered )
return; return;
#if TARGET_HOST_UNIX_X11 #if TARGET_HOST_UNIX_X11
glXSwapBuffers( fgDisplay.Display, fgStructure.Window->Window.Handle ); glXSwapBuffers( fgDisplay.Display, fgStructure.Window->Window.Handle );

View File

@ -65,10 +65,10 @@ void fghRememberState( void )
* restore the ViewPort on LeaveGameMode(): * restore the ViewPort on LeaveGameMode():
*/ */
XF86VidModeGetViewPort( XF86VidModeGetViewPort(
fgDisplay.Display, fgDisplay.Display,
fgDisplay.Screen, fgDisplay.Screen,
&fgDisplay.DisplayViewPortX, &fgDisplay.DisplayViewPortX,
&fgDisplay.DisplayViewPortY &fgDisplay.DisplayViewPortY
); );
/* /*
@ -76,15 +76,15 @@ void fghRememberState( void )
* for restoring it later: * for restoring it later:
*/ */
{ {
Window junk_window; Window junk_window;
unsigned int mask; unsigned int mask;
XQueryPointer( XQueryPointer(
fgDisplay.Display, fgDisplay.RootWindow, fgDisplay.Display, fgDisplay.RootWindow,
&junk_window, &junk_window, &junk_window, &junk_window,
&fgDisplay.DisplayPointerX, &fgDisplay.DisplayPointerY, &fgDisplay.DisplayPointerX, &fgDisplay.DisplayPointerY,
&fgDisplay.DisplayPointerX, &fgDisplay.DisplayPointerY, &mask &fgDisplay.DisplayPointerX, &fgDisplay.DisplayPointerY, &mask
); );
} }
/* /*
@ -99,7 +99,7 @@ void fghRememberState( void )
); );
if (!fgDisplay.DisplayModeValid) if (!fgDisplay.DisplayModeValid)
fgWarning( "Runtime use of XF86VidModeGetModeLine failed.\n" ); fgWarning( "Runtime use of XF86VidModeGetModeLine failed.\n" );
# else # else
# warning fghRememberState: missing XFree86 video mode extensions, game mode will not change screen resolution when activated # warning fghRememberState: missing XFree86 video mode extensions, game mode will not change screen resolution when activated
@ -138,8 +138,8 @@ void fghRestoreState( void )
* Restore the remembered pointer position: * Restore the remembered pointer position:
*/ */
XWarpPointer( XWarpPointer(
fgDisplay.Display, None, fgDisplay.RootWindow, 0, 0, 0, 0, fgDisplay.Display, None, fgDisplay.RootWindow, 0, 0, 0, 0,
fgDisplay.DisplayPointerX, fgDisplay.DisplayPointerY fgDisplay.DisplayPointerX, fgDisplay.DisplayPointerY
); );
/* /*
@ -179,22 +179,22 @@ void fghRestoreState( void )
displayModes[ i ] displayModes[ i ]
); );
/* /*
* Now we can restore the remembered ViewPort: * Now we can restore the remembered ViewPort:
*/ */
XF86VidModeSetViewPort( XF86VidModeSetViewPort(
fgDisplay.Display, fgDisplay.Display,
fgDisplay.Screen, fgDisplay.Screen,
fgDisplay.DisplayViewPortX, fgDisplay.DisplayViewPortX,
fgDisplay.DisplayViewPortY fgDisplay.DisplayViewPortY
); );
/* /*
* For the case this would be the last X11 call the application * For the case this would be the last X11 call the application
* calls exit() we've to flush the X11 output queue to have the * calls exit() we've to flush the X11 output queue to have the
* commands sent to the X server before the application exists. * commands sent to the X server before the application exists.
*/ */
XFlush(fgDisplay.Display); XFlush(fgDisplay.Display);
return; return;
} }
@ -266,8 +266,8 @@ GLboolean fghChangeDisplayMode( GLboolean haveToTest )
if( fghCheckDisplayMode( displayModes[ i ]->hdisplay, displayModes[ i ]->vdisplay, if( fghCheckDisplayMode( displayModes[ i ]->hdisplay, displayModes[ i ]->vdisplay,
fgState.GameModeDepth, fgState.GameModeRefresh ) ) fgState.GameModeDepth, fgState.GameModeRefresh ) )
{ {
if( haveToTest ) if( haveToTest )
return( TRUE ); return( TRUE );
/* /*
* OKi, this is the display mode we have been looking for... * OKi, this is the display mode we have been looking for...
*/ */
@ -346,7 +346,7 @@ GLboolean fghChangeDisplayMode( GLboolean haveToTest )
mode = displayModes; mode = displayModes;
break; break;
} }
/* /*
* Switch to the next display mode, if any * Switch to the next display mode, if any
*/ */
@ -458,7 +458,7 @@ int FGAPIENTRY glutEnterGameMode( void )
*/ */
if( fghChangeDisplayMode( FALSE ) == FALSE ) if( fghChangeDisplayMode( FALSE ) == FALSE )
{ {
fgWarning( "failed to change screen settings" ); fgWarning( "failed to change screen settings" );
return( FALSE ); return( FALSE );
} }
@ -482,11 +482,11 @@ int FGAPIENTRY glutEnterGameMode( void )
/* Move the Pointer to the middle of the fullscreen window */ /* Move the Pointer to the middle of the fullscreen window */
XWarpPointer( XWarpPointer(
fgDisplay.Display, fgDisplay.Display,
None, None,
fgDisplay.RootWindow, fgDisplay.RootWindow,
0, 0, 0, 0, 0, 0, 0, 0,
fgState.GameModeSize.X/2, fgState.GameModeSize.Y/2 fgState.GameModeSize.X/2, fgState.GameModeSize.Y/2
); );
/* /*
@ -499,12 +499,12 @@ int FGAPIENTRY glutEnterGameMode( void )
* the application which we have to aviod, so wait until it's viewable: * the application which we have to aviod, so wait until it's viewable:
*/ */
while (GrabSuccess != XGrabPointer( while (GrabSuccess != XGrabPointer(
fgDisplay.Display, fgStructure.GameMode->Window.Handle, fgDisplay.Display, fgStructure.GameMode->Window.Handle,
TRUE, ButtonPressMask|ButtonReleaseMask|ButtonMotionMask TRUE, ButtonPressMask|ButtonReleaseMask|ButtonMotionMask
|PointerMotionMask, |PointerMotionMask,
GrabModeAsync, GrabModeAsync, GrabModeAsync, GrabModeAsync,
fgStructure.GameMode->Window.Handle, None, CurrentTime)) { fgStructure.GameMode->Window.Handle, None, CurrentTime)) {
usleep (100); usleep (100);
} }
/* /*
@ -521,31 +521,31 @@ int FGAPIENTRY glutEnterGameMode( void )
# ifdef X_XF86VidModeSetViewPort # ifdef X_XF86VidModeSetViewPort
if (fgDisplay.DisplayModeValid) { if (fgDisplay.DisplayModeValid) {
int x, y; int x, y;
Window child; Window child;
/* /*
* Change to viewport to the window topleft edge: * Change to viewport to the window topleft edge:
*/ */
XF86VidModeSetViewPort(fgDisplay.Display, fgDisplay.Screen, 0, 0); XF86VidModeSetViewPort(fgDisplay.Display, fgDisplay.Screen, 0, 0);
/* /*
* Final window repositioning: It could be avoided using an undecorated * Final window repositioning: It could be avoided using an undecorated
* window using override_redirect, but this * would possily require more * window using override_redirect, but this * would possily require more
* changes and investigation. * changes and investigation.
*/ */
/* Get the current postion of the drawable area on screen */ /* Get the current postion of the drawable area on screen */
XTranslateCoordinates( XTranslateCoordinates(
fgDisplay.Display, fgDisplay.Display,
fgStructure.Window->Window.Handle, fgStructure.Window->Window.Handle,
fgDisplay.RootWindow, fgDisplay.RootWindow,
0, 0, &x, &y, 0, 0, &x, &y,
&child &child
); );
/* Move the decorataions out of the topleft corner of the display */ /* Move the decorataions out of the topleft corner of the display */
XMoveWindow(fgDisplay.Display, fgStructure.Window->Window.Handle, -x, -y); XMoveWindow(fgDisplay.Display, fgStructure.Window->Window.Handle, -x, -y);
} }
#endif #endif

View File

@ -230,9 +230,9 @@ void FGAPIENTRY glutSolidSphere( GLdouble dRadius, GLint slices, GLint stacks )
glVertex3d( glVertex3d(
radius * *(row + 3 * i + 0), radius * *(row + 3 * i + 0),
radius * *(row + 3 * i + 1), radius * *(row + 3 * i + 1),
radius * *(row + 3 * i + 2) radius * *(row + 3 * i + 2)
); );
phi += dphi; phi += dphi;
} }
@ -263,8 +263,8 @@ void FGAPIENTRY glutSolidSphere( GLdouble dRadius, GLint slices, GLint stacks )
glVertex3d( glVertex3d(
radius * *(row + 3 * i + 0), radius * *(row + 3 * i + 0),
radius * *(row + 3 * i + 1), radius * *(row + 3 * i + 1),
radius * *(row + 3 * i + 2) radius * *(row + 3 * i + 2)
); );
glNormal3dv( next + i * 3 ); glNormal3dv( next + i * 3 );
glVertex3d( glVertex3d(
@ -300,8 +300,8 @@ void FGAPIENTRY glutSolidSphere( GLdouble dRadius, GLint slices, GLint stacks )
glVertex3d( glVertex3d(
radius * *(row + 3 * i + 0), radius * *(row + 3 * i + 0),
radius * *(row + 3 * i + 1), radius * *(row + 3 * i + 1),
radius * *(row + 3 * i + 2) radius * *(row + 3 * i + 2)
); );
} }
glEnd(); glEnd();