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:
parent
c89d0c24d9
commit
02e53500a7
@ -75,44 +75,44 @@ void FGAPIENTRY glutSetCursor( int cursorID )
|
||||
* Print a warning message?
|
||||
*/
|
||||
{
|
||||
Cursor cursor;
|
||||
Cursor cursor;
|
||||
#define MAP_CURSOR(a,b) case a: cursor = XCreateFontCursor( fgDisplay.Display, b ); break;
|
||||
if( GLUT_CURSOR_FULL_CROSSHAIR == cursorID )
|
||||
cursorID = GLUT_CURSOR_CROSSHAIR;
|
||||
if( GLUT_CURSOR_FULL_CROSSHAIR == cursorID )
|
||||
cursorID = GLUT_CURSOR_CROSSHAIR;
|
||||
|
||||
switch( cursorID )
|
||||
switch( cursorID )
|
||||
{
|
||||
MAP_CURSOR( GLUT_CURSOR_RIGHT_ARROW, XC_right_ptr);
|
||||
MAP_CURSOR( GLUT_CURSOR_LEFT_ARROW, XC_left_ptr);
|
||||
MAP_CURSOR( GLUT_CURSOR_INFO, XC_hand1);
|
||||
MAP_CURSOR( GLUT_CURSOR_DESTROY, XC_pirate);
|
||||
MAP_CURSOR( GLUT_CURSOR_HELP, XC_question_arrow);
|
||||
MAP_CURSOR( GLUT_CURSOR_CYCLE, XC_exchange);
|
||||
MAP_CURSOR( GLUT_CURSOR_SPRAY, XC_spraycan);
|
||||
MAP_CURSOR( GLUT_CURSOR_WAIT, XC_watch);
|
||||
MAP_CURSOR( GLUT_CURSOR_TEXT, XC_xterm);
|
||||
MAP_CURSOR( GLUT_CURSOR_CROSSHAIR, XC_crosshair);
|
||||
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_TOP_SIDE, XC_top_side);
|
||||
MAP_CURSOR( GLUT_CURSOR_BOTTOM_SIDE, XC_bottom_side);
|
||||
MAP_CURSOR( GLUT_CURSOR_LEFT_SIDE, XC_left_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_RIGHT_CORNER, XC_top_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_NONE, XC_bogosity);
|
||||
case GLUT_CURSOR_INHERIT:
|
||||
break;
|
||||
default:
|
||||
return;
|
||||
}
|
||||
MAP_CURSOR( GLUT_CURSOR_RIGHT_ARROW, XC_right_ptr);
|
||||
MAP_CURSOR( GLUT_CURSOR_LEFT_ARROW, XC_left_ptr);
|
||||
MAP_CURSOR( GLUT_CURSOR_INFO, XC_hand1);
|
||||
MAP_CURSOR( GLUT_CURSOR_DESTROY, XC_pirate);
|
||||
MAP_CURSOR( GLUT_CURSOR_HELP, XC_question_arrow);
|
||||
MAP_CURSOR( GLUT_CURSOR_CYCLE, XC_exchange);
|
||||
MAP_CURSOR( GLUT_CURSOR_SPRAY, XC_spraycan);
|
||||
MAP_CURSOR( GLUT_CURSOR_WAIT, XC_watch);
|
||||
MAP_CURSOR( GLUT_CURSOR_TEXT, XC_xterm);
|
||||
MAP_CURSOR( GLUT_CURSOR_CROSSHAIR, XC_crosshair);
|
||||
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_TOP_SIDE, XC_top_side);
|
||||
MAP_CURSOR( GLUT_CURSOR_BOTTOM_SIDE, XC_bottom_side);
|
||||
MAP_CURSOR( GLUT_CURSOR_LEFT_SIDE, XC_left_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_RIGHT_CORNER, XC_top_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_NONE, XC_bogosity);
|
||||
case GLUT_CURSOR_INHERIT:
|
||||
break;
|
||||
default:
|
||||
return;
|
||||
}
|
||||
|
||||
if( GLUT_CURSOR_INHERIT == cursorID )
|
||||
XUndefineCursor( fgDisplay.Display, fgStructure.Window->Window.Handle );
|
||||
else
|
||||
XDefineCursor( fgDisplay.Display, fgStructure.Window->Window.Handle, cursor );
|
||||
if( GLUT_CURSOR_INHERIT == cursorID )
|
||||
XUndefineCursor( fgDisplay.Display, fgStructure.Window->Window.Handle );
|
||||
else
|
||||
XDefineCursor( fgDisplay.Display, fgStructure.Window->Window.Handle, cursor );
|
||||
}
|
||||
|
||||
#elif TARGET_HOST_WIN32
|
||||
@ -121,32 +121,32 @@ void FGAPIENTRY glutSetCursor( int cursorID )
|
||||
* This is a temporary solution only...
|
||||
*/
|
||||
/* 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)); \
|
||||
break;
|
||||
/* Nuke the cursor AND change it for this window class. */
|
||||
# define ZAP_CURSOR(a,b) case a: SetCursor( NULL ); \
|
||||
/* Nuke the cursor AND change it for this window class. */
|
||||
# define ZAP_CURSOR(a,b) case a: SetCursor( NULL ); \
|
||||
SetClassLong(fgStructure.Window->Window.Handle,GCL_HCURSOR,(LONG)NULL); \
|
||||
break;
|
||||
|
||||
switch( cursorID )
|
||||
{
|
||||
MAP_CURSOR( GLUT_CURSOR_RIGHT_ARROW, IDC_ARROW );
|
||||
MAP_CURSOR( GLUT_CURSOR_LEFT_ARROW, IDC_ARROW );
|
||||
MAP_CURSOR( GLUT_CURSOR_INFO, IDC_HELP );
|
||||
MAP_CURSOR( GLUT_CURSOR_DESTROY, IDC_CROSS );
|
||||
MAP_CURSOR( GLUT_CURSOR_HELP, IDC_HELP );
|
||||
MAP_CURSOR( GLUT_CURSOR_CYCLE, IDC_SIZEALL );
|
||||
MAP_CURSOR( GLUT_CURSOR_SPRAY, IDC_CROSS );
|
||||
MAP_CURSOR( GLUT_CURSOR_WAIT, IDC_WAIT );
|
||||
MAP_CURSOR( GLUT_CURSOR_TEXT, IDC_UPARROW );
|
||||
MAP_CURSOR( GLUT_CURSOR_CROSSHAIR, IDC_CROSS );
|
||||
/* MAP_CURSOR( GLUT_CURSOR_NONE, IDC_NO ); */
|
||||
ZAP_CURSOR( GLUT_CURSOR_NONE, NULL );
|
||||
switch( cursorID )
|
||||
{
|
||||
MAP_CURSOR( GLUT_CURSOR_RIGHT_ARROW, IDC_ARROW );
|
||||
MAP_CURSOR( GLUT_CURSOR_LEFT_ARROW, IDC_ARROW );
|
||||
MAP_CURSOR( GLUT_CURSOR_INFO, IDC_HELP );
|
||||
MAP_CURSOR( GLUT_CURSOR_DESTROY, IDC_CROSS );
|
||||
MAP_CURSOR( GLUT_CURSOR_HELP, IDC_HELP );
|
||||
MAP_CURSOR( GLUT_CURSOR_CYCLE, IDC_SIZEALL );
|
||||
MAP_CURSOR( GLUT_CURSOR_SPRAY, IDC_CROSS );
|
||||
MAP_CURSOR( GLUT_CURSOR_WAIT, IDC_WAIT );
|
||||
MAP_CURSOR( GLUT_CURSOR_TEXT, IDC_UPARROW );
|
||||
MAP_CURSOR( GLUT_CURSOR_CROSSHAIR, IDC_CROSS );
|
||||
/* MAP_CURSOR( GLUT_CURSOR_NONE, IDC_NO ); */
|
||||
ZAP_CURSOR( GLUT_CURSOR_NONE, NULL );
|
||||
|
||||
default:
|
||||
MAP_CURSOR( GLUT_CURSOR_UP_DOWN, IDC_ARROW );
|
||||
}
|
||||
default:
|
||||
MAP_CURSOR( GLUT_CURSOR_UP_DOWN, IDC_ARROW );
|
||||
}
|
||||
#endif
|
||||
|
||||
fgStructure.Window->State.Cursor = cursorID;
|
||||
|
@ -57,7 +57,7 @@ void FGAPIENTRY glutSwapBuffers( void )
|
||||
|
||||
glFlush();
|
||||
if ( ! fgStructure.Window->Window.DoubleBuffered )
|
||||
return;
|
||||
return;
|
||||
|
||||
#if TARGET_HOST_UNIX_X11
|
||||
glXSwapBuffers( fgDisplay.Display, fgStructure.Window->Window.Handle );
|
||||
|
@ -65,10 +65,10 @@ void fghRememberState( void )
|
||||
* restore the ViewPort on LeaveGameMode():
|
||||
*/
|
||||
XF86VidModeGetViewPort(
|
||||
fgDisplay.Display,
|
||||
fgDisplay.Screen,
|
||||
&fgDisplay.DisplayViewPortX,
|
||||
&fgDisplay.DisplayViewPortY
|
||||
fgDisplay.Display,
|
||||
fgDisplay.Screen,
|
||||
&fgDisplay.DisplayViewPortX,
|
||||
&fgDisplay.DisplayViewPortY
|
||||
);
|
||||
|
||||
/*
|
||||
@ -76,15 +76,15 @@ void fghRememberState( void )
|
||||
* for restoring it later:
|
||||
*/
|
||||
{
|
||||
Window junk_window;
|
||||
unsigned int mask;
|
||||
Window junk_window;
|
||||
unsigned int mask;
|
||||
|
||||
XQueryPointer(
|
||||
fgDisplay.Display, fgDisplay.RootWindow,
|
||||
&junk_window, &junk_window,
|
||||
&fgDisplay.DisplayPointerX, &fgDisplay.DisplayPointerY,
|
||||
&fgDisplay.DisplayPointerX, &fgDisplay.DisplayPointerY, &mask
|
||||
);
|
||||
XQueryPointer(
|
||||
fgDisplay.Display, fgDisplay.RootWindow,
|
||||
&junk_window, &junk_window,
|
||||
&fgDisplay.DisplayPointerX, &fgDisplay.DisplayPointerY,
|
||||
&fgDisplay.DisplayPointerX, &fgDisplay.DisplayPointerY, &mask
|
||||
);
|
||||
}
|
||||
|
||||
/*
|
||||
@ -99,7 +99,7 @@ void fghRememberState( void )
|
||||
);
|
||||
|
||||
if (!fgDisplay.DisplayModeValid)
|
||||
fgWarning( "Runtime use of XF86VidModeGetModeLine failed.\n" );
|
||||
fgWarning( "Runtime use of XF86VidModeGetModeLine failed.\n" );
|
||||
|
||||
# else
|
||||
# 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:
|
||||
*/
|
||||
XWarpPointer(
|
||||
fgDisplay.Display, None, fgDisplay.RootWindow, 0, 0, 0, 0,
|
||||
fgDisplay.DisplayPointerX, fgDisplay.DisplayPointerY
|
||||
fgDisplay.Display, None, fgDisplay.RootWindow, 0, 0, 0, 0,
|
||||
fgDisplay.DisplayPointerX, fgDisplay.DisplayPointerY
|
||||
);
|
||||
|
||||
/*
|
||||
@ -179,22 +179,22 @@ void fghRestoreState( void )
|
||||
displayModes[ i ]
|
||||
);
|
||||
|
||||
/*
|
||||
* Now we can restore the remembered ViewPort:
|
||||
*/
|
||||
XF86VidModeSetViewPort(
|
||||
fgDisplay.Display,
|
||||
fgDisplay.Screen,
|
||||
fgDisplay.DisplayViewPortX,
|
||||
fgDisplay.DisplayViewPortY
|
||||
);
|
||||
/*
|
||||
* Now we can restore the remembered ViewPort:
|
||||
*/
|
||||
XF86VidModeSetViewPort(
|
||||
fgDisplay.Display,
|
||||
fgDisplay.Screen,
|
||||
fgDisplay.DisplayViewPortX,
|
||||
fgDisplay.DisplayViewPortY
|
||||
);
|
||||
|
||||
/*
|
||||
* 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
|
||||
* commands sent to the X server before the application exists.
|
||||
*/
|
||||
XFlush(fgDisplay.Display);
|
||||
/*
|
||||
* 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
|
||||
* commands sent to the X server before the application exists.
|
||||
*/
|
||||
XFlush(fgDisplay.Display);
|
||||
|
||||
return;
|
||||
}
|
||||
@ -266,8 +266,8 @@ GLboolean fghChangeDisplayMode( GLboolean haveToTest )
|
||||
if( fghCheckDisplayMode( displayModes[ i ]->hdisplay, displayModes[ i ]->vdisplay,
|
||||
fgState.GameModeDepth, fgState.GameModeRefresh ) )
|
||||
{
|
||||
if( haveToTest )
|
||||
return( TRUE );
|
||||
if( haveToTest )
|
||||
return( TRUE );
|
||||
/*
|
||||
* OKi, this is the display mode we have been looking for...
|
||||
*/
|
||||
@ -458,7 +458,7 @@ int FGAPIENTRY glutEnterGameMode( void )
|
||||
*/
|
||||
if( fghChangeDisplayMode( FALSE ) == FALSE )
|
||||
{
|
||||
fgWarning( "failed to change screen settings" );
|
||||
fgWarning( "failed to change screen settings" );
|
||||
return( FALSE );
|
||||
}
|
||||
|
||||
@ -482,11 +482,11 @@ int FGAPIENTRY glutEnterGameMode( void )
|
||||
|
||||
/* Move the Pointer to the middle of the fullscreen window */
|
||||
XWarpPointer(
|
||||
fgDisplay.Display,
|
||||
None,
|
||||
fgDisplay.RootWindow,
|
||||
0, 0, 0, 0,
|
||||
fgState.GameModeSize.X/2, fgState.GameModeSize.Y/2
|
||||
fgDisplay.Display,
|
||||
None,
|
||||
fgDisplay.RootWindow,
|
||||
0, 0, 0, 0,
|
||||
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:
|
||||
*/
|
||||
while (GrabSuccess != XGrabPointer(
|
||||
fgDisplay.Display, fgStructure.GameMode->Window.Handle,
|
||||
TRUE, ButtonPressMask|ButtonReleaseMask|ButtonMotionMask
|
||||
|PointerMotionMask,
|
||||
GrabModeAsync, GrabModeAsync,
|
||||
fgStructure.GameMode->Window.Handle, None, CurrentTime)) {
|
||||
usleep (100);
|
||||
fgDisplay.Display, fgStructure.GameMode->Window.Handle,
|
||||
TRUE, ButtonPressMask|ButtonReleaseMask|ButtonMotionMask
|
||||
|PointerMotionMask,
|
||||
GrabModeAsync, GrabModeAsync,
|
||||
fgStructure.GameMode->Window.Handle, None, CurrentTime)) {
|
||||
usleep (100);
|
||||
}
|
||||
|
||||
/*
|
||||
@ -521,31 +521,31 @@ int FGAPIENTRY glutEnterGameMode( void )
|
||||
# ifdef X_XF86VidModeSetViewPort
|
||||
|
||||
if (fgDisplay.DisplayModeValid) {
|
||||
int x, y;
|
||||
Window child;
|
||||
int x, y;
|
||||
Window child;
|
||||
|
||||
/*
|
||||
* Change to viewport to the window topleft edge:
|
||||
*/
|
||||
XF86VidModeSetViewPort(fgDisplay.Display, fgDisplay.Screen, 0, 0);
|
||||
/*
|
||||
* Change to viewport to the window topleft edge:
|
||||
*/
|
||||
XF86VidModeSetViewPort(fgDisplay.Display, fgDisplay.Screen, 0, 0);
|
||||
|
||||
/*
|
||||
* Final window repositioning: It could be avoided using an undecorated
|
||||
* window using override_redirect, but this * would possily require more
|
||||
* changes and investigation.
|
||||
*/
|
||||
/*
|
||||
* Final window repositioning: It could be avoided using an undecorated
|
||||
* window using override_redirect, but this * would possily require more
|
||||
* changes and investigation.
|
||||
*/
|
||||
|
||||
/* Get the current postion of the drawable area on screen */
|
||||
XTranslateCoordinates(
|
||||
fgDisplay.Display,
|
||||
fgStructure.Window->Window.Handle,
|
||||
fgDisplay.RootWindow,
|
||||
0, 0, &x, &y,
|
||||
&child
|
||||
);
|
||||
XTranslateCoordinates(
|
||||
fgDisplay.Display,
|
||||
fgStructure.Window->Window.Handle,
|
||||
fgDisplay.RootWindow,
|
||||
0, 0, &x, &y,
|
||||
&child
|
||||
);
|
||||
|
||||
/* Move the decorataions out of the topleft corner of the display */
|
||||
XMoveWindow(fgDisplay.Display, fgStructure.Window->Window.Handle, -x, -y);
|
||||
/* Move the decorataions out of the topleft corner of the display */
|
||||
XMoveWindow(fgDisplay.Display, fgStructure.Window->Window.Handle, -x, -y);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -230,8 +230,8 @@ void FGAPIENTRY glutSolidSphere( GLdouble dRadius, GLint slices, GLint stacks )
|
||||
glVertex3d(
|
||||
radius * *(row + 3 * i + 0),
|
||||
radius * *(row + 3 * i + 1),
|
||||
radius * *(row + 3 * i + 2)
|
||||
);
|
||||
radius * *(row + 3 * i + 2)
|
||||
);
|
||||
|
||||
phi += dphi;
|
||||
}
|
||||
@ -263,8 +263,8 @@ void FGAPIENTRY glutSolidSphere( GLdouble dRadius, GLint slices, GLint stacks )
|
||||
glVertex3d(
|
||||
radius * *(row + 3 * i + 0),
|
||||
radius * *(row + 3 * i + 1),
|
||||
radius * *(row + 3 * i + 2)
|
||||
);
|
||||
radius * *(row + 3 * i + 2)
|
||||
);
|
||||
|
||||
glNormal3dv( next + i * 3 );
|
||||
glVertex3d(
|
||||
@ -300,8 +300,8 @@ void FGAPIENTRY glutSolidSphere( GLdouble dRadius, GLint slices, GLint stacks )
|
||||
glVertex3d(
|
||||
radius * *(row + 3 * i + 0),
|
||||
radius * *(row + 3 * i + 1),
|
||||
radius * *(row + 3 * i + 2)
|
||||
);
|
||||
radius * *(row + 3 * i + 2)
|
||||
);
|
||||
}
|
||||
|
||||
glEnd();
|
||||
|
Reference in New Issue
Block a user