some function renaming, etc (John Fay)
git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@514 7f0cb862-5218-0410-a997-914c9d46530a
This commit is contained in:
parent
413bd1e861
commit
447cac3357
@ -49,7 +49,7 @@
|
|||||||
|
|
||||||
#if TARGET_HOST_UNIX_X11
|
#if TARGET_HOST_UNIX_X11
|
||||||
|
|
||||||
int fgGetCursorError( Cursor cursor )
|
static int fghGetCursorError( Cursor cursor )
|
||||||
{
|
{
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
char buf[ 256 ];
|
char buf[ 256 ];
|
||||||
@ -90,7 +90,7 @@ void FGAPIENTRY glutSetCursor( int cursorID )
|
|||||||
/*
|
/*
|
||||||
* Open issues:
|
* Open issues:
|
||||||
* (a) Partial error checking. Is that a problem?
|
* (a) Partial error checking. Is that a problem?
|
||||||
* Is fgGetCursorError() correct? Should we abort on errors?
|
* Is fghGetCursorError() correct? Should we abort on errors?
|
||||||
* Should there be a freeglut-wide X error handler? Should
|
* Should there be a freeglut-wide X error handler? Should
|
||||||
* we use the X error-handler mechanism?
|
* we use the X error-handler mechanism?
|
||||||
* (b) FULL_CROSSHAIR demotes to plain CROSSHAIR. Old GLUT allows
|
* (b) FULL_CROSSHAIR demotes to plain CROSSHAIR. Old GLUT allows
|
||||||
@ -171,7 +171,7 @@ void FGAPIENTRY glutSetCursor( int cursorID )
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
error = fgGetCursorError( cursor );
|
error = fghGetCursorError( cursor );
|
||||||
|
|
||||||
if( GLUT_CURSOR_INHERIT == cursorID )
|
if( GLUT_CURSOR_INHERIT == cursorID )
|
||||||
XUndefineCursor( fgDisplay.Display,
|
XUndefineCursor( fgDisplay.Display,
|
||||||
|
@ -48,7 +48,7 @@
|
|||||||
* Remembers the current visual settings, so that
|
* Remembers the current visual settings, so that
|
||||||
* we can change them and restore later...
|
* we can change them and restore later...
|
||||||
*/
|
*/
|
||||||
void fghRememberState( void )
|
static void fghRememberState( void )
|
||||||
{
|
{
|
||||||
#if TARGET_HOST_UNIX_X11
|
#if TARGET_HOST_UNIX_X11
|
||||||
|
|
||||||
@ -127,7 +127,7 @@ void fghRememberState( void )
|
|||||||
/*
|
/*
|
||||||
* Restores the previously remembered visual settings
|
* Restores the previously remembered visual settings
|
||||||
*/
|
*/
|
||||||
void fghRestoreState( void )
|
static void fghRestoreState( void )
|
||||||
{
|
{
|
||||||
#if TARGET_HOST_UNIX_X11
|
#if TARGET_HOST_UNIX_X11
|
||||||
|
|
||||||
@ -207,7 +207,7 @@ void fghRestoreState( void )
|
|||||||
/*
|
/*
|
||||||
* Checks the display mode settings against user's preferences
|
* Checks the display mode settings against user's preferences
|
||||||
*/
|
*/
|
||||||
GLboolean fghCheckDisplayMode( int width, int height, int depth, int refresh )
|
static GLboolean fghCheckDisplayMode( int width, int height, int depth, int refresh )
|
||||||
{
|
{
|
||||||
/* The desired values should be stored in fgState structure... */
|
/* The desired values should be stored in fgState structure... */
|
||||||
return ( width == fgState.GameModeSize.X ) &&
|
return ( width == fgState.GameModeSize.X ) &&
|
||||||
@ -219,7 +219,7 @@ GLboolean fghCheckDisplayMode( int width, int height, int depth, int refresh )
|
|||||||
/*
|
/*
|
||||||
* Changes the current display mode to match user's settings
|
* Changes the current display mode to match user's settings
|
||||||
*/
|
*/
|
||||||
GLboolean fghChangeDisplayMode( GLboolean haveToTest )
|
static GLboolean fghChangeDisplayMode( GLboolean haveToTest )
|
||||||
{
|
{
|
||||||
#if TARGET_HOST_UNIX_X11
|
#if TARGET_HOST_UNIX_X11
|
||||||
|
|
||||||
|
@ -121,7 +121,7 @@ void FGAPIENTRY glutSolidCube( GLdouble dSize )
|
|||||||
* The sign of n can be flipped to get the reverse loop
|
* The sign of n can be flipped to get the reverse loop
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static void circleTable(double **sint,double **cost,const int n)
|
static void fghCircleTable(double **sint,double **cost,const int n)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
@ -144,7 +144,7 @@ static void circleTable(double **sint,double **cost,const int n)
|
|||||||
{
|
{
|
||||||
free(*sint);
|
free(*sint);
|
||||||
free(*cost);
|
free(*cost);
|
||||||
fgError("Failed to allocate memory in circleTable");
|
fgError("Failed to allocate memory in fghCircleTable");
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Compute cos and sin around the circle */
|
/* Compute cos and sin around the circle */
|
||||||
@ -177,8 +177,8 @@ void FGAPIENTRY glutSolidSphere(GLdouble radius, GLint slices, GLint stacks)
|
|||||||
|
|
||||||
double *sint1,*cost1;
|
double *sint1,*cost1;
|
||||||
double *sint2,*cost2;
|
double *sint2,*cost2;
|
||||||
circleTable(&sint1,&cost1,-slices);
|
fghCircleTable(&sint1,&cost1,-slices);
|
||||||
circleTable(&sint2,&cost2,stacks*2);
|
fghCircleTable(&sint2,&cost2,stacks*2);
|
||||||
|
|
||||||
/* The top stack is covered with a triangle fan */
|
/* The top stack is covered with a triangle fan */
|
||||||
|
|
||||||
@ -262,8 +262,8 @@ void FGAPIENTRY glutWireSphere(GLdouble radius, GLint slices, GLint stacks)
|
|||||||
|
|
||||||
double *sint1,*cost1;
|
double *sint1,*cost1;
|
||||||
double *sint2,*cost2;
|
double *sint2,*cost2;
|
||||||
circleTable(&sint1,&cost1,-slices );
|
fghCircleTable(&sint1,&cost1,-slices );
|
||||||
circleTable(&sint2,&cost2, stacks*2);
|
fghCircleTable(&sint2,&cost2, stacks*2);
|
||||||
|
|
||||||
/* Draw a line loop for each stack */
|
/* Draw a line loop for each stack */
|
||||||
|
|
||||||
@ -336,7 +336,7 @@ void FGAPIENTRY glutSolidCone( GLdouble base, GLdouble height, GLint slices, GLi
|
|||||||
/* Pre-computed circle */
|
/* Pre-computed circle */
|
||||||
|
|
||||||
double *sint,*cost;
|
double *sint,*cost;
|
||||||
circleTable(&sint,&cost,-slices);
|
fghCircleTable(&sint,&cost,-slices);
|
||||||
|
|
||||||
/* Cover the circular base with a triangle fan... */
|
/* Cover the circular base with a triangle fan... */
|
||||||
|
|
||||||
@ -420,7 +420,7 @@ void FGAPIENTRY glutWireCone( GLdouble base, GLdouble height, GLint slices, GLin
|
|||||||
/* Pre-computed circle */
|
/* Pre-computed circle */
|
||||||
|
|
||||||
double *sint,*cost;
|
double *sint,*cost;
|
||||||
circleTable(&sint,&cost,-slices);
|
fghCircleTable(&sint,&cost,-slices);
|
||||||
|
|
||||||
/* Draw the stacks... */
|
/* Draw the stacks... */
|
||||||
|
|
||||||
@ -477,7 +477,7 @@ void FGAPIENTRY glutSolidCylinder(GLdouble radius, GLdouble height, GLint slices
|
|||||||
/* Pre-computed circle */
|
/* Pre-computed circle */
|
||||||
|
|
||||||
double *sint,*cost;
|
double *sint,*cost;
|
||||||
circleTable(&sint,&cost,-slices);
|
fghCircleTable(&sint,&cost,-slices);
|
||||||
|
|
||||||
/* Cover the base and top */
|
/* Cover the base and top */
|
||||||
|
|
||||||
@ -538,7 +538,7 @@ void FGAPIENTRY glutWireCylinder(GLdouble radius, GLdouble height, GLint slices,
|
|||||||
/* Pre-computed circle */
|
/* Pre-computed circle */
|
||||||
|
|
||||||
double *sint,*cost;
|
double *sint,*cost;
|
||||||
circleTable(&sint,&cost,-slices);
|
fghCircleTable(&sint,&cost,-slices);
|
||||||
|
|
||||||
/* Draw the stacks... */
|
/* Draw the stacks... */
|
||||||
|
|
||||||
|
@ -95,7 +95,7 @@ SFG_State fgState = { { -1, -1, GL_FALSE }, /* Position */
|
|||||||
/*
|
/*
|
||||||
* A call to this function should initialize all the display stuff...
|
* A call to this function should initialize all the display stuff...
|
||||||
*/
|
*/
|
||||||
void fgInitialize( const char* displayName )
|
static void fghInitialize( const char* displayName )
|
||||||
{
|
{
|
||||||
#if TARGET_HOST_UNIX_X11
|
#if TARGET_HOST_UNIX_X11
|
||||||
fgDisplay.Display = XOpenDisplay( displayName );
|
fgDisplay.Display = XOpenDisplay( displayName );
|
||||||
@ -616,7 +616,7 @@ void FGAPIENTRY glutInit( int* pargc, char** argv )
|
|||||||
* in the program arguments, we will use the DISPLAY environment
|
* in the program arguments, we will use the DISPLAY environment
|
||||||
* variable for opening the X display (see code above):
|
* variable for opening the X display (see code above):
|
||||||
*/
|
*/
|
||||||
fgInitialize( displayName );
|
fghInitialize( displayName );
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Geometry parsing deffered until here because we may need the screen
|
* Geometry parsing deffered until here because we may need the screen
|
||||||
|
@ -655,11 +655,9 @@ extern SFG_State fgState;
|
|||||||
#define freeglut_assert_menu assert( fgStructure.Menu != NULL );
|
#define freeglut_assert_menu assert( fgStructure.Menu != NULL );
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The initialize and deinitialize functions get called on glutInit()
|
* The deinitialize function gets called on glutMainLoop() end. It should clean up
|
||||||
* and glutMainLoop() end respectively. They should create/clean up
|
|
||||||
* everything inside of the freeglut
|
* everything inside of the freeglut
|
||||||
*/
|
*/
|
||||||
void fgInitialize( const char* displayName );
|
|
||||||
void fgDeinitialize( void );
|
void fgDeinitialize( void );
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -437,14 +437,14 @@ io_object_t ioDevices[K_NUM_DEVICES];
|
|||||||
static void fghJoystickFindDevices ( SFG_Joystick* joy, mach_port_t );
|
static void fghJoystickFindDevices ( SFG_Joystick* joy, mach_port_t );
|
||||||
static CFDictionaryRef fghJoystickGetCFProperties ( SFG_Joystick* joy, io_object_t );
|
static CFDictionaryRef fghJoystickGetCFProperties ( SFG_Joystick* joy, io_object_t );
|
||||||
|
|
||||||
void fghJoystickEnumerateElements ( SFG_Joystick* joy, CFTypeRef element );
|
static void fghJoystickEnumerateElements ( SFG_Joystick* joy, CFTypeRef element );
|
||||||
/* callback for CFArrayApply */
|
/* callback for CFArrayApply */
|
||||||
static void fghJoystickElementEnumerator ( SFG_Joystick* joy, void *element, void* vjs );
|
static void fghJoystickElementEnumerator ( SFG_Joystick* joy, void *element, void* vjs );
|
||||||
void fghJoystickParseElement ( SFG_Joystick* joy, CFDictionaryRef element );
|
static void fghJoystickParseElement ( SFG_Joystick* joy, CFDictionaryRef element );
|
||||||
|
|
||||||
void fghJoystickAddAxisElement ( SFG_Joystick* joy, CFDictionaryRef axis );
|
static void fghJoystickAddAxisElement ( SFG_Joystick* joy, CFDictionaryRef axis );
|
||||||
void fghJoystickAddButtonElement ( SFG_Joystick* joy, CFDictionaryRef button );
|
static void fghJoystickAddButtonElement ( SFG_Joystick* joy, CFDictionaryRef button );
|
||||||
void fghJoystickAddHatElement ( SFG_Joystick* joy, CFDictionaryRef hat );
|
static void fghJoystickAddHatElement ( SFG_Joystick* joy, CFDictionaryRef hat );
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
@ -413,44 +413,44 @@ void fgWarning( const char *fmt, ... )
|
|||||||
* and all other "joystick timer" code can be yanked.
|
* and all other "joystick timer" code can be yanked.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
static void fgCheckJoystickCallback( SFG_Window* w, SFG_Enumerator* e)
|
static void fghCheckJoystickCallback( SFG_Window* w, SFG_Enumerator* e)
|
||||||
{
|
{
|
||||||
if( FETCH_WCB( *w, Joystick ) )
|
if( FETCH_WCB( *w, Joystick ) )
|
||||||
{
|
{
|
||||||
e->found = GL_TRUE;
|
e->found = GL_TRUE;
|
||||||
e->data = w;
|
e->data = w;
|
||||||
}
|
}
|
||||||
fgEnumSubWindows( w, fgCheckJoystickCallback, e );
|
fgEnumSubWindows( w, fghCheckJoystickCallback, e );
|
||||||
}
|
}
|
||||||
static int fgHaveJoystick( void )
|
static int fghHaveJoystick( void )
|
||||||
{
|
{
|
||||||
SFG_Enumerator enumerator;
|
SFG_Enumerator enumerator;
|
||||||
enumerator.found = GL_FALSE;
|
enumerator.found = GL_FALSE;
|
||||||
enumerator.data = NULL;
|
enumerator.data = NULL;
|
||||||
fgEnumWindows( fgCheckJoystickCallback, &enumerator );
|
fgEnumWindows( fghCheckJoystickCallback, &enumerator );
|
||||||
return !!enumerator.data;
|
return !!enumerator.data;
|
||||||
}
|
}
|
||||||
static void fgHavePendingRedisplaysCallback( SFG_Window* w, SFG_Enumerator* e)
|
static void fghHavePendingRedisplaysCallback( SFG_Window* w, SFG_Enumerator* e)
|
||||||
{
|
{
|
||||||
if( w->State.Redisplay )
|
if( w->State.Redisplay )
|
||||||
{
|
{
|
||||||
e->found = GL_TRUE;
|
e->found = GL_TRUE;
|
||||||
e->data = w;
|
e->data = w;
|
||||||
}
|
}
|
||||||
fgEnumSubWindows( w, fgHavePendingRedisplaysCallback, e );
|
fgEnumSubWindows( w, fghHavePendingRedisplaysCallback, e );
|
||||||
}
|
}
|
||||||
static int fgHavePendingRedisplays (void)
|
static int fghHavePendingRedisplays (void)
|
||||||
{
|
{
|
||||||
SFG_Enumerator enumerator;
|
SFG_Enumerator enumerator;
|
||||||
enumerator.found = GL_FALSE;
|
enumerator.found = GL_FALSE;
|
||||||
enumerator.data = NULL;
|
enumerator.data = NULL;
|
||||||
fgEnumWindows( fgHavePendingRedisplaysCallback, &enumerator );
|
fgEnumWindows( fghHavePendingRedisplaysCallback, &enumerator );
|
||||||
return !!enumerator.data;
|
return !!enumerator.data;
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
* Returns the number of GLUT ticks (milliseconds) till the next timer event.
|
* Returns the number of GLUT ticks (milliseconds) till the next timer event.
|
||||||
*/
|
*/
|
||||||
static long fgNextTimer( void )
|
static long fghNextTimer( void )
|
||||||
{
|
{
|
||||||
long ret = INT_MAX;
|
long ret = INT_MAX;
|
||||||
SFG_Timer *timer = fgState.Timers.First;
|
SFG_Timer *timer = fgState.Timers.First;
|
||||||
@ -466,16 +466,16 @@ static long fgNextTimer( void )
|
|||||||
* Does the magic required to relinquish the CPU until something interesting
|
* Does the magic required to relinquish the CPU until something interesting
|
||||||
* happens.
|
* happens.
|
||||||
*/
|
*/
|
||||||
static void fgSleepForEvents( void )
|
static void fghSleepForEvents( void )
|
||||||
{
|
{
|
||||||
long msec;
|
long msec;
|
||||||
|
|
||||||
if( fgState.IdleCallback || fgHavePendingRedisplays( ) )
|
if( fgState.IdleCallback || fghHavePendingRedisplays( ) )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
msec = fgNextTimer( );
|
msec = fghNextTimer( );
|
||||||
if( fgHaveJoystick( ) ) /* XXX Use GLUT timers for joysticks... */
|
if( fghHaveJoystick( ) ) /* XXX Use GLUT timers for joysticks... */
|
||||||
msec = MIN( msec, 10 ); /* XXX Dumb; forces granularity to .01sec */
|
msec = MIN( msec, 10 ); /* XXX Dumb; forces granularity to .01sec */
|
||||||
|
|
||||||
#if TARGET_HOST_UNIX_X11
|
#if TARGET_HOST_UNIX_X11
|
||||||
/*
|
/*
|
||||||
@ -513,7 +513,7 @@ static void fgSleepForEvents( void )
|
|||||||
/*
|
/*
|
||||||
* Returns GLUT modifier mask for an XEvent.
|
* Returns GLUT modifier mask for an XEvent.
|
||||||
*/
|
*/
|
||||||
int fgGetXModifiers( XEvent *event )
|
static int fghGetXModifiers( XEvent *event )
|
||||||
{
|
{
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
|
||||||
@ -871,7 +871,7 @@ void FGAPIENTRY glutMainLoopEvent( void )
|
|||||||
! FETCH_WCB( *window, MouseWheel ) )
|
! FETCH_WCB( *window, MouseWheel ) )
|
||||||
break;
|
break;
|
||||||
|
|
||||||
fgState.Modifiers = fgGetXModifiers( &event );
|
fgState.Modifiers = fghGetXModifiers( &event );
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Finally execute the mouse or mouse wheel callback
|
* Finally execute the mouse or mouse wheel callback
|
||||||
@ -995,7 +995,7 @@ void FGAPIENTRY glutMainLoopEvent( void )
|
|||||||
if( keyboard_cb )
|
if( keyboard_cb )
|
||||||
{
|
{
|
||||||
fgSetWindow( window );
|
fgSetWindow( window );
|
||||||
fgState.Modifiers = fgGetXModifiers( &event );
|
fgState.Modifiers = fghGetXModifiers( &event );
|
||||||
keyboard_cb( asciiCode[ 0 ],
|
keyboard_cb( asciiCode[ 0 ],
|
||||||
event.xkey.x, event.xkey.y
|
event.xkey.x, event.xkey.y
|
||||||
);
|
);
|
||||||
@ -1049,7 +1049,7 @@ void FGAPIENTRY glutMainLoopEvent( void )
|
|||||||
if( special_cb && (special != -1) )
|
if( special_cb && (special != -1) )
|
||||||
{
|
{
|
||||||
fgSetWindow( window );
|
fgSetWindow( window );
|
||||||
fgState.Modifiers = fgGetXModifiers( &event );
|
fgState.Modifiers = fghGetXModifiers( &event );
|
||||||
special_cb( special, event.xkey.x, event.xkey.y );
|
special_cb( special, event.xkey.x, event.xkey.y );
|
||||||
fgState.Modifiers = 0xffffffff;
|
fgState.Modifiers = 0xffffffff;
|
||||||
}
|
}
|
||||||
@ -1160,7 +1160,7 @@ void FGAPIENTRY glutMainLoop( void )
|
|||||||
if( fgState.IdleCallback )
|
if( fgState.IdleCallback )
|
||||||
fgState.IdleCallback( );
|
fgState.IdleCallback( );
|
||||||
|
|
||||||
fgSleepForEvents( );
|
fghSleepForEvents( );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1189,7 +1189,7 @@ void FGAPIENTRY glutLeaveMainLoop( void )
|
|||||||
/*
|
/*
|
||||||
* Determine a GLUT modifer mask based on MS-WINDOWS system info.
|
* Determine a GLUT modifer mask based on MS-WINDOWS system info.
|
||||||
*/
|
*/
|
||||||
int fgGetWin32Modifiers (void)
|
static int fghGetWin32Modifiers (void)
|
||||||
{
|
{
|
||||||
return
|
return
|
||||||
( ( ( GetKeyState( VK_LSHIFT ) < 0 ) ||
|
( ( ( GetKeyState( VK_LSHIFT ) < 0 ) ||
|
||||||
@ -1415,7 +1415,7 @@ LRESULT CALLBACK fgWindowProc( HWND hWnd, UINT uMsg, WPARAM wParam,
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
fgState.Modifiers = fgGetWin32Modifiers( );
|
fgState.Modifiers = fghGetWin32Modifiers( );
|
||||||
|
|
||||||
if( ( wParam & MK_LBUTTON ) ||
|
if( ( wParam & MK_LBUTTON ) ||
|
||||||
( wParam & MK_MBUTTON ) ||
|
( wParam & MK_MBUTTON ) ||
|
||||||
@ -1567,7 +1567,7 @@ LRESULT CALLBACK fgWindowProc( HWND hWnd, UINT uMsg, WPARAM wParam,
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
fgSetWindow( window );
|
fgSetWindow( window );
|
||||||
fgState.Modifiers = fgGetWin32Modifiers( );
|
fgState.Modifiers = fghGetWin32Modifiers( );
|
||||||
|
|
||||||
INVOKE_WCB(
|
INVOKE_WCB(
|
||||||
*window, Mouse,
|
*window, Mouse,
|
||||||
@ -1612,7 +1612,7 @@ LRESULT CALLBACK fgWindowProc( HWND hWnd, UINT uMsg, WPARAM wParam,
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
fgSetWindow( window );
|
fgSetWindow( window );
|
||||||
fgState.Modifiers = fgGetWin32Modifiers( );
|
fgState.Modifiers = fghGetWin32Modifiers( );
|
||||||
|
|
||||||
while( ticks-- )
|
while( ticks-- )
|
||||||
if( FETCH_WCB( *window, MouseWheel ) )
|
if( FETCH_WCB( *window, MouseWheel ) )
|
||||||
@ -1659,7 +1659,7 @@ LRESULT CALLBACK fgWindowProc( HWND hWnd, UINT uMsg, WPARAM wParam,
|
|||||||
* Remember the current modifiers state. This is done here in order
|
* Remember the current modifiers state. This is done here in order
|
||||||
* to make sure the VK_DELETE keyboard callback is executed properly.
|
* to make sure the VK_DELETE keyboard callback is executed properly.
|
||||||
*/
|
*/
|
||||||
fgState.Modifiers = fgGetWin32Modifiers( );
|
fgState.Modifiers = fghGetWin32Modifiers( );
|
||||||
|
|
||||||
GetCursorPos( &mouse_pos );
|
GetCursorPos( &mouse_pos );
|
||||||
ScreenToClient( window->Window.Handle, &mouse_pos );
|
ScreenToClient( window->Window.Handle, &mouse_pos );
|
||||||
@ -1747,7 +1747,7 @@ LRESULT CALLBACK fgWindowProc( HWND hWnd, UINT uMsg, WPARAM wParam,
|
|||||||
* Remember the current modifiers state. This is done here in order
|
* Remember the current modifiers state. This is done here in order
|
||||||
* to make sure the VK_DELETE keyboard callback is executed properly.
|
* to make sure the VK_DELETE keyboard callback is executed properly.
|
||||||
*/
|
*/
|
||||||
fgState.Modifiers = fgGetWin32Modifiers( );
|
fgState.Modifiers = fghGetWin32Modifiers( );
|
||||||
|
|
||||||
GetCursorPos( &mouse_pos );
|
GetCursorPos( &mouse_pos );
|
||||||
ScreenToClient( window->Window.Handle, &mouse_pos );
|
ScreenToClient( window->Window.Handle, &mouse_pos );
|
||||||
@ -1828,7 +1828,7 @@ LRESULT CALLBACK fgWindowProc( HWND hWnd, UINT uMsg, WPARAM wParam,
|
|||||||
if( (fgState.KeyRepeat==GLUT_KEY_REPEAT_OFF || window->State.IgnoreKeyRepeat==GL_TRUE) && (HIWORD(lParam) & KF_REPEAT) )
|
if( (fgState.KeyRepeat==GLUT_KEY_REPEAT_OFF || window->State.IgnoreKeyRepeat==GL_TRUE) && (HIWORD(lParam) & KF_REPEAT) )
|
||||||
break;
|
break;
|
||||||
|
|
||||||
fgState.Modifiers = fgGetWin32Modifiers( );
|
fgState.Modifiers = fghGetWin32Modifiers( );
|
||||||
INVOKE_WCB( *window, Keyboard,
|
INVOKE_WCB( *window, Keyboard,
|
||||||
( (char)wParam,
|
( (char)wParam,
|
||||||
window->State.MouseX, window->State.MouseY )
|
window->State.MouseX, window->State.MouseY )
|
||||||
|
@ -53,7 +53,7 @@ SFG_Structure fgStructure = { { NULL, NULL }, /* The list of windows */
|
|||||||
|
|
||||||
/* -- PRIVATE FUNCTIONS ---------------------------------------------------- */
|
/* -- PRIVATE FUNCTIONS ---------------------------------------------------- */
|
||||||
|
|
||||||
void fgClearCallBacks( SFG_Window *window )
|
static void fghClearCallBacks( SFG_Window *window )
|
||||||
{
|
{
|
||||||
if( window )
|
if( window )
|
||||||
{
|
{
|
||||||
@ -77,7 +77,7 @@ SFG_Window* fgCreateWindow( SFG_Window* parent, const char* title,
|
|||||||
SFG_Window *window = (SFG_Window *)calloc( sizeof(SFG_Window), 1 );
|
SFG_Window *window = (SFG_Window *)calloc( sizeof(SFG_Window), 1 );
|
||||||
int fakeArgc = 0;
|
int fakeArgc = 0;
|
||||||
|
|
||||||
fgClearCallBacks( window );
|
fghClearCallBacks( window );
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If the freeglut internals haven't been initialized yet,
|
* If the freeglut internals haven't been initialized yet,
|
||||||
@ -187,7 +187,7 @@ void fgAddToWindowDestroyList( SFG_Window* window )
|
|||||||
*/
|
*/
|
||||||
{
|
{
|
||||||
FGCBDestroy destroy = FETCH_WCB( *window, Destroy );
|
FGCBDestroy destroy = FETCH_WCB( *window, Destroy );
|
||||||
fgClearCallBacks( window );
|
fghClearCallBacks( window );
|
||||||
SET_WCB( *window, Destroy, destroy );
|
SET_WCB( *window, Destroy, destroy );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -239,7 +239,7 @@ void fgDestroyWindow( SFG_Window* window )
|
|||||||
if( window->Menu[ menu_index ] )
|
if( window->Menu[ menu_index ] )
|
||||||
window->Menu[ menu_index ]->ParentWindow = NULL;
|
window->Menu[ menu_index ]->ParentWindow = NULL;
|
||||||
|
|
||||||
fgClearCallBacks( window );
|
fghClearCallBacks( window );
|
||||||
fgCloseWindow( window );
|
fgCloseWindow( window );
|
||||||
free( window );
|
free( window );
|
||||||
if( fgStructure.Window == window )
|
if( fgStructure.Window == window )
|
||||||
|
@ -84,7 +84,7 @@
|
|||||||
/* -- PRIVATE FUNCTIONS ---------------------------------------------------- */
|
/* -- PRIVATE FUNCTIONS ---------------------------------------------------- */
|
||||||
|
|
||||||
|
|
||||||
static void teapot( GLint grid, GLdouble scale, GLenum type )
|
static void fghTeapot( GLint grid, GLdouble scale, GLenum type )
|
||||||
{
|
{
|
||||||
#if TARGET_HOST_WINCE
|
#if TARGET_HOST_WINCE
|
||||||
int i, numV=sizeof(strip_vertices)/4, numI=sizeof(strip_normals)/4;
|
int i, numV=sizeof(strip_vertices)/4, numI=sizeof(strip_normals)/4;
|
||||||
@ -183,7 +183,7 @@ static void teapot( GLint grid, GLdouble scale, GLenum type )
|
|||||||
void FGAPIENTRY glutWireTeapot( GLdouble size )
|
void FGAPIENTRY glutWireTeapot( GLdouble size )
|
||||||
{
|
{
|
||||||
/* We will use the general teapot rendering code */
|
/* We will use the general teapot rendering code */
|
||||||
teapot( 10, size, GL_LINE );
|
fghTeapot( 10, size, GL_LINE );
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -192,7 +192,7 @@ void FGAPIENTRY glutWireTeapot( GLdouble size )
|
|||||||
void FGAPIENTRY glutSolidTeapot( GLdouble size )
|
void FGAPIENTRY glutSolidTeapot( GLdouble size )
|
||||||
{
|
{
|
||||||
/* We will use the general teapot rendering code */
|
/* We will use the general teapot rendering code */
|
||||||
teapot( 7, size, GL_FILL );
|
fghTeapot( 7, size, GL_FILL );
|
||||||
}
|
}
|
||||||
|
|
||||||
/*** END OF FILE ***/
|
/*** END OF FILE ***/
|
||||||
|
@ -36,7 +36,7 @@
|
|||||||
#include <aygshell.h>
|
#include <aygshell.h>
|
||||||
#pragma comment( lib, "Aygshell.lib" )
|
#pragma comment( lib, "Aygshell.lib" )
|
||||||
|
|
||||||
wchar_t* wstr_from_str(const char* str)
|
static wchar_t* fghWstrFromStr(const char* str)
|
||||||
{
|
{
|
||||||
int i,len=strlen(str);
|
int i,len=strlen(str);
|
||||||
wchar_t* wstr = (wchar_t*)malloc(2*len+2);
|
wchar_t* wstr = (wchar_t*)malloc(2*len+2);
|
||||||
@ -558,7 +558,7 @@ void fgOpenWindow( SFG_Window* window, const char* title,
|
|||||||
|
|
||||||
#if TARGET_HOST_WINCE
|
#if TARGET_HOST_WINCE
|
||||||
{
|
{
|
||||||
wchar_t* wstr = wstr_from_str(title);
|
wchar_t* wstr = fghWstrFromStr(title);
|
||||||
|
|
||||||
window->Window.Handle = CreateWindow(
|
window->Window.Handle = CreateWindow(
|
||||||
_T("FREEGLUT"),
|
_T("FREEGLUT"),
|
||||||
@ -849,7 +849,7 @@ void FGAPIENTRY glutSetWindowTitle( const char* title )
|
|||||||
|
|
||||||
#elif TARGET_HOST_WINCE
|
#elif TARGET_HOST_WINCE
|
||||||
{
|
{
|
||||||
wchar_t* wstr = wstr_from_str(title);
|
wchar_t* wstr = fghWstrFromStr(title);
|
||||||
|
|
||||||
SetWindowText( fgStructure.Window->Window.Handle, wstr );
|
SetWindowText( fgStructure.Window->Window.Handle, wstr );
|
||||||
|
|
||||||
@ -892,7 +892,7 @@ void FGAPIENTRY glutSetIconTitle( const char* title )
|
|||||||
|
|
||||||
#elif TARGET_HOST_WINCE
|
#elif TARGET_HOST_WINCE
|
||||||
{
|
{
|
||||||
wchar_t* wstr = wstr_from_str(title);
|
wchar_t* wstr = fghWstrFromStr(title);
|
||||||
|
|
||||||
SetWindowText( fgStructure.Window->Window.Handle, wstr );
|
SetWindowText( fgStructure.Window->Window.Handle, wstr );
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user