Rationalizing the names of the platform-specific functions so that they begin with "fgPlatform"
git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@1000 7f0cb862-5218-0410-a997-914c9d46530a
This commit is contained in:
parent
2b9a6f6732
commit
d36338f9f1
@ -39,8 +39,8 @@
|
||||
|
||||
/* -- PRIVATE FUNCTIONS --------------------------------------------------- */
|
||||
|
||||
extern void fghSetCursor ( SFG_Window *window, int cursorID );
|
||||
extern void fghWarpPointer ( int x, int y );
|
||||
extern void fgPlatformSetCursor ( SFG_Window *window, int cursorID );
|
||||
extern void fgPlatformWarpPointer ( int x, int y );
|
||||
|
||||
#if TARGET_HOST_POSIX_X11 || TARGET_HOST_MAC_OSX || TARGET_HOST_SOLARIS
|
||||
#include <X11/cursorfont.h>
|
||||
@ -104,7 +104,7 @@ static cursorCacheEntry cursorCache[] = {
|
||||
{ XC_bottom_left_corner, None } /* GLUT_CURSOR_BOTTOM_LEFT_CORNER */
|
||||
};
|
||||
|
||||
static void fghSetCursor ( SFG_Window *window, int cursorID )
|
||||
static void fgPlatformSetCursor ( SFG_Window *window, int cursorID )
|
||||
{
|
||||
Cursor cursor;
|
||||
/*
|
||||
@ -150,7 +150,7 @@ static void fghSetCursor ( SFG_Window *window, int cursorID )
|
||||
}
|
||||
|
||||
|
||||
static void fghWarpPointer ( int x, int y )
|
||||
static void fgPlatformWarpPointer ( int x, int y )
|
||||
{
|
||||
XWarpPointer(
|
||||
fgDisplay.Display,
|
||||
@ -168,7 +168,7 @@ static void fghWarpPointer ( int x, int y )
|
||||
/* -- INTERNAL FUNCTIONS ---------------------------------------------------- */
|
||||
void fgSetCursor ( SFG_Window *window, int cursorID )
|
||||
{
|
||||
fghSetCursor ( window, cursorID );
|
||||
fgPlatformSetCursor ( window, cursorID );
|
||||
}
|
||||
|
||||
|
||||
@ -182,7 +182,7 @@ void FGAPIENTRY glutSetCursor( int cursorID )
|
||||
FREEGLUT_EXIT_IF_NOT_INITIALISED ( "glutSetCursor" );
|
||||
FREEGLUT_EXIT_IF_NO_WINDOW ( "glutSetCursor" );
|
||||
|
||||
fghSetCursor ( fgStructure.CurrentWindow, cursorID );
|
||||
fgPlatformSetCursor ( fgStructure.CurrentWindow, cursorID );
|
||||
fgStructure.CurrentWindow->State.Cursor = cursorID;
|
||||
}
|
||||
|
||||
@ -194,7 +194,7 @@ void FGAPIENTRY glutWarpPointer( int x, int y )
|
||||
FREEGLUT_EXIT_IF_NOT_INITIALISED ( "glutWarpPointer" );
|
||||
FREEGLUT_EXIT_IF_NO_WINDOW ( "glutWarpPointer" );
|
||||
|
||||
fghWarpPointer ( x, y );
|
||||
fgPlatformWarpPointer ( x, y );
|
||||
}
|
||||
|
||||
/*** END OF FILE ***/
|
||||
|
@ -30,7 +30,7 @@
|
||||
#include "freeglut_internal.h"
|
||||
|
||||
extern SFG_Proc fghGetProcAddress( const char *procName );
|
||||
extern GLUTproc fghGetPlatformSpecificGLUTProcAddress( const char *procName );
|
||||
extern GLUTproc fgPlatformGlutGetProcAddress( const char *procName );
|
||||
|
||||
static GLUTproc fghGetGLUTProcAddress( const char* procName )
|
||||
{
|
||||
@ -223,6 +223,12 @@ static GLUTproc fghGetGLUTProcAddress( const char* procName )
|
||||
}
|
||||
|
||||
|
||||
static GLUTproc fgPlatformGlutGetProcAddress( const char* procName )
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
SFG_Proc fghGetProcAddress( const char *procName )
|
||||
{
|
||||
#if defined( GLX_ARB_get_proc_address )
|
||||
@ -245,7 +251,7 @@ glutGetProcAddress( const char *procName )
|
||||
|
||||
/* Some GLUT functions are platform-specific: */
|
||||
if ( !p )
|
||||
p = fghGetPlatformSpecificGLUTProcAddress( procName );
|
||||
p = fgPlatformGlutGetProcAddress( procName );
|
||||
|
||||
return ( p != NULL ) ? p : fghGetProcAddress( procName );
|
||||
}
|
||||
|
@ -39,9 +39,9 @@
|
||||
|
||||
|
||||
/* -- PRIVATE FUNCTIONS ---------------------------------------------------- */
|
||||
extern void fghRememberState( void );
|
||||
extern void fghRestoreState( void );
|
||||
extern GLboolean fghChangeDisplayMode( GLboolean haveToTest );
|
||||
extern void fgPlatformRememberState( void );
|
||||
extern void fgPlatformRestoreState( void );
|
||||
extern GLboolean fgPlatformChangeDisplayMode( GLboolean haveToTest );
|
||||
|
||||
|
||||
#if TARGET_HOST_POSIX_X11
|
||||
@ -163,7 +163,7 @@ static int xrandr_resize(int xsz, int ysz, int rate, int just_checking)
|
||||
* Remembers the current visual settings, so that
|
||||
* we can change them and restore later...
|
||||
*/
|
||||
static void fghRememberState( void )
|
||||
static void fgPlatformRememberState( void )
|
||||
{
|
||||
int event_base, error_base;
|
||||
|
||||
@ -248,7 +248,7 @@ static void fghRememberState( void )
|
||||
/*
|
||||
* Restores the previously remembered visual settings
|
||||
*/
|
||||
static void fghRestoreState( void )
|
||||
static void fgPlatformRestoreState( void )
|
||||
{
|
||||
/* Restore the remembered pointer position: */
|
||||
XWarpPointer(
|
||||
@ -398,7 +398,7 @@ static int fghCheckDisplayModes( GLboolean exactMatch, int displayModesCount, XF
|
||||
/*
|
||||
* Changes the current display mode to match user's settings
|
||||
*/
|
||||
static GLboolean fghChangeDisplayMode( GLboolean haveToTest )
|
||||
static GLboolean fgPlatformChangeDisplayMode( GLboolean haveToTest )
|
||||
{
|
||||
GLboolean success = GL_FALSE;
|
||||
/* first try to use XRandR, then fallback to XF86VidMode */
|
||||
@ -532,7 +532,7 @@ void FGAPIENTRY glutGameModeString( const char* string )
|
||||
|
||||
/* All values not specified are now set to -1, which means those
|
||||
* aspects of the current display mode are not changed in
|
||||
* fghChangeDisplayMode() above.
|
||||
* fgPlatformChangeDisplayMode() above.
|
||||
*/
|
||||
fgState.GameModeSize.X = width;
|
||||
fgState.GameModeSize.Y = height;
|
||||
@ -552,9 +552,9 @@ int FGAPIENTRY glutEnterGameMode( void )
|
||||
if( fgStructure.GameModeWindow )
|
||||
fgAddToWindowDestroyList( fgStructure.GameModeWindow );
|
||||
else
|
||||
fghRememberState( );
|
||||
fgPlatformRememberState( );
|
||||
|
||||
if( ! fghChangeDisplayMode( GL_FALSE ) )
|
||||
if( ! fgPlatformChangeDisplayMode( GL_FALSE ) )
|
||||
{
|
||||
fgWarning( "failed to change screen settings" );
|
||||
return 0;
|
||||
@ -680,7 +680,7 @@ void FGAPIENTRY glutLeaveGameMode( void )
|
||||
|
||||
#endif
|
||||
|
||||
fghRestoreState();
|
||||
fgPlatformRestoreState();
|
||||
}
|
||||
|
||||
/*
|
||||
@ -696,7 +696,7 @@ int FGAPIENTRY glutGameModeGet( GLenum eWhat )
|
||||
return !!fgStructure.GameModeWindow;
|
||||
|
||||
case GLUT_GAME_MODE_POSSIBLE:
|
||||
return fghChangeDisplayMode( GL_TRUE );
|
||||
return fgPlatformChangeDisplayMode( GL_TRUE );
|
||||
|
||||
case GLUT_GAME_MODE_WIDTH:
|
||||
return fgState.GameModeSize.X;
|
||||
|
@ -100,9 +100,9 @@ SFG_State fgState = { { -1, -1, GL_FALSE }, /* Position */
|
||||
|
||||
/* -- PRIVATE FUNCTIONS ---------------------------------------------------- */
|
||||
|
||||
extern void fghInitialize( const char* displayName );
|
||||
extern void fghDeinitialiseInputDevices ( void );
|
||||
extern void fghCloseDisplay ( void );
|
||||
extern void fgPlatformInitialize( const char* displayName );
|
||||
extern void fgPlatformDeinitialiseInputDevices ( void );
|
||||
extern void fgPlatformCloseDisplay ( void );
|
||||
|
||||
#if TARGET_HOST_POSIX_X11
|
||||
|
||||
@ -246,7 +246,7 @@ int fgHintPresent(Window window, Atom property, Atom hint)
|
||||
/*
|
||||
* A call to this function should initialize all the display stuff...
|
||||
*/
|
||||
static void fghInitialize( const char* displayName )
|
||||
static void fgPlatformInitialize( const char* displayName )
|
||||
{
|
||||
fgDisplay.Display = XOpenDisplay( displayName );
|
||||
|
||||
@ -437,7 +437,7 @@ void fghCloseInputDevices ( void )
|
||||
|
||||
|
||||
#if TARGET_HOST_POSIX_X11
|
||||
static void fghDeinitialiseInputDevices ( void )
|
||||
static void fgPlatformDeinitialiseInputDevices ( void )
|
||||
{
|
||||
fghCloseInputDevices ();
|
||||
|
||||
@ -446,7 +446,7 @@ static void fghDeinitialiseInputDevices ( void )
|
||||
}
|
||||
|
||||
|
||||
static void fghCloseDisplay ( void )
|
||||
static void fgPlatformCloseDisplay ( void )
|
||||
{
|
||||
/*
|
||||
* Make sure all X-client data we have created will be destroyed on
|
||||
@ -506,7 +506,7 @@ void fgDeinitialize( void )
|
||||
free( timer );
|
||||
}
|
||||
|
||||
fghDeinitialiseInputDevices ();
|
||||
fgPlatformDeinitialiseInputDevices ();
|
||||
|
||||
fgState.MouseWheelTicks = 0;
|
||||
|
||||
@ -560,7 +560,7 @@ void fgDeinitialize( void )
|
||||
fgState.ProgramName = NULL;
|
||||
}
|
||||
|
||||
fghCloseDisplay ();
|
||||
fgPlatformCloseDisplay ();
|
||||
|
||||
fgState.Initialised = GL_FALSE;
|
||||
}
|
||||
@ -617,7 +617,7 @@ void FGAPIENTRY glutInit( int* pargc, char** argv )
|
||||
* in the program arguments, we will use the DISPLAY environment
|
||||
* variable for opening the X display (see code above):
|
||||
*/
|
||||
fghInitialize( displayName );
|
||||
fgPlatformInitialize( displayName );
|
||||
|
||||
/*
|
||||
* Geometry parsing deffered until here because we may need the screen
|
||||
|
@ -99,7 +99,7 @@ extern int serial_getchar ( SERIALPORT *port );
|
||||
extern int serial_putchar ( SERIALPORT *port, unsigned char ch );
|
||||
extern void serial_flush ( SERIALPORT *port );
|
||||
|
||||
extern void fghRegisterDialDevice ( const char *dial_device );
|
||||
extern void fgPlatformRegisterDialDevice ( const char *dial_device );
|
||||
static void send_dial_event(int dial, int value);
|
||||
static void poll_dials(int id);
|
||||
|
||||
@ -128,7 +128,7 @@ int fgInputDeviceDetect( void )
|
||||
* Try initializing the input device(s)
|
||||
*/
|
||||
#if TARGET_HOST_POSIX_X11
|
||||
static void fghRegisterDialDevice ( const char *dial_device )
|
||||
static void fgPlatformRegisterDialDevice ( const char *dial_device )
|
||||
{
|
||||
}
|
||||
#endif
|
||||
@ -139,7 +139,7 @@ void fgInitialiseInputDevices ( void )
|
||||
{
|
||||
const char *dial_device=NULL;
|
||||
dial_device = getenv ( "GLUT_DIALS_SERIAL" );
|
||||
fghRegisterDialDevice ( dial_device );
|
||||
fgPlatformRegisterDialDevice ( dial_device );
|
||||
|
||||
if ( !dial_device ) return;
|
||||
if ( !( dialbox_port = serial_open ( dial_device ) ) ) return;
|
||||
|
@ -859,7 +859,7 @@ GLXFBConfig* fgChooseFBConfig( int* numcfgs );
|
||||
|
||||
/* The window procedure for Win32 events handling */
|
||||
#if TARGET_HOST_MS_WINDOWS
|
||||
LRESULT CALLBACK fgWindowProc( HWND hWnd, UINT uMsg,
|
||||
LRESULT CALLBACK fgPlatformWindowProc( HWND hWnd, UINT uMsg,
|
||||
WPARAM wParam, LPARAM lParam );
|
||||
void fgNewWGLCreateContext( SFG_Window* window );
|
||||
GLboolean fgSetupPixelFormat( SFG_Window* window, GLboolean checkOnly,
|
||||
|
@ -77,11 +77,11 @@ struct GXKeyList gxKeyList;
|
||||
static pCloseTouchInputHandle fghCloseTouchInputHandle = (pCloseTouchInputHandle)0xDEADBEEF;
|
||||
#endif
|
||||
|
||||
extern void fghPlatformReshapeWindow ( SFG_Window *window, int width, int height );
|
||||
extern void fghcbPlatformDisplayWindow ( SFG_Window *window );
|
||||
extern void fghPlatformSleepForEvents( long msec );
|
||||
extern void fghProcessSingleEvent ( void );
|
||||
extern void fghMainLoopPreliminaryWork ( void );
|
||||
extern void fgPlatformReshapeWindow ( SFG_Window *window, int width, int height );
|
||||
extern void fgPlatformDisplayWindow ( SFG_Window *window );
|
||||
extern void fgPlatformSleepForEvents( long msec );
|
||||
extern void fgPlatformProcessSingleEvent ( void );
|
||||
extern void fgPlatformMainLoopPreliminaryWork ( void );
|
||||
|
||||
|
||||
/*
|
||||
@ -103,7 +103,7 @@ extern void fghMainLoopPreliminaryWork ( void );
|
||||
* match the new window size.
|
||||
*/
|
||||
#if TARGET_HOST_POSIX_X11
|
||||
static void fghPlatformReshapeWindow ( SFG_Window *window, int width, int height )
|
||||
static void fgPlatformReshapeWindow ( SFG_Window *window, int width, int height )
|
||||
{
|
||||
XResizeWindow( fgDisplay.Display, window->Window.Handle,
|
||||
width, height );
|
||||
@ -117,7 +117,7 @@ static void fghReshapeWindow ( SFG_Window *window, int width, int height )
|
||||
|
||||
freeglut_return_if_fail( window != NULL );
|
||||
|
||||
fghPlatformReshapeWindow ( window, width, height );
|
||||
fgPlatformReshapeWindow ( window, width, height );
|
||||
|
||||
if( FETCH_WCB( *window, Reshape ) )
|
||||
INVOKE_WCB( *window, Reshape, ( width, height ) );
|
||||
@ -177,7 +177,7 @@ void fghRedrawWindow ( SFG_Window *window )
|
||||
* A static helper function to execute display callback for a window
|
||||
*/
|
||||
#if TARGET_HOST_POSIX_X11
|
||||
static void fghcbPlatformDisplayWindow ( SFG_Window *window )
|
||||
static void fgPlatformDisplayWindow ( SFG_Window *window )
|
||||
{
|
||||
fghRedrawWindow ( window ) ;
|
||||
}
|
||||
@ -190,7 +190,7 @@ static void fghcbDisplayWindow( SFG_Window *window,
|
||||
window->State.Visible )
|
||||
{
|
||||
window->State.Redisplay = GL_FALSE;
|
||||
fghcbPlatformDisplayWindow ( window );
|
||||
fgPlatformDisplayWindow ( window );
|
||||
}
|
||||
|
||||
fgEnumSubWindows( window, fghcbDisplayWindow, enumerator );
|
||||
@ -423,7 +423,7 @@ static long fghNextTimer( void )
|
||||
*/
|
||||
|
||||
#if TARGET_HOST_POSIX_X11
|
||||
static void fghPlatformSleepForEvents( long msec )
|
||||
static void fgPlatformSleepForEvents( long msec )
|
||||
{
|
||||
/*
|
||||
* Possibly due to aggressive use of XFlush() and friends,
|
||||
@ -469,14 +469,14 @@ static void fghSleepForEvents( void )
|
||||
if( fghHaveJoystick( ) && ( msec > 10 ) )
|
||||
msec = 10;
|
||||
|
||||
fghPlatformSleepForEvents ( msec );
|
||||
fgPlatformSleepForEvents ( msec );
|
||||
}
|
||||
|
||||
#if TARGET_HOST_POSIX_X11
|
||||
/*
|
||||
* Returns GLUT modifier mask for the state field of an X11 event.
|
||||
*/
|
||||
int fghGetModifiers( int state )
|
||||
int fgPlatformGetModifiers( int state )
|
||||
{
|
||||
int ret = 0;
|
||||
|
||||
@ -933,7 +933,7 @@ static void fghPrintEvent( XEvent *event )
|
||||
}
|
||||
|
||||
|
||||
void fghProcessSingleEvent ( void )
|
||||
void fgPlatformProcessSingleEvent ( void )
|
||||
{
|
||||
SFG_Window* window;
|
||||
XEvent event;
|
||||
@ -1147,7 +1147,7 @@ void fghProcessSingleEvent ( void )
|
||||
* XXX track ButtonPress/ButtonRelease events in our own
|
||||
* XXX bit-mask?
|
||||
*/
|
||||
fgState.Modifiers = fghGetModifiers( event.xmotion.state );
|
||||
fgState.Modifiers = fgPlatformGetModifiers( event.xmotion.state );
|
||||
if ( event.xmotion.state & ( Button1Mask | Button2Mask | Button3Mask | Button4Mask | Button5Mask ) ) {
|
||||
INVOKE_WCB( *window, Motion, ( event.xmotion.x,
|
||||
event.xmotion.y ) );
|
||||
@ -1201,7 +1201,7 @@ void fghProcessSingleEvent ( void )
|
||||
! FETCH_WCB( *window, MouseWheel ) )
|
||||
break;
|
||||
|
||||
fgState.Modifiers = fghGetModifiers( event.xbutton.state );
|
||||
fgState.Modifiers = fgPlatformGetModifiers( event.xbutton.state );
|
||||
|
||||
/* Finally execute the mouse or mouse wheel callback */
|
||||
if( ( button < glutDeviceGet ( GLUT_NUM_MOUSE_BUTTONS ) ) || ( ! FETCH_WCB( *window, MouseWheel ) ) )
|
||||
@ -1316,7 +1316,7 @@ void fghProcessSingleEvent ( void )
|
||||
if( keyboard_cb )
|
||||
{
|
||||
fgSetWindow( window );
|
||||
fgState.Modifiers = fghGetModifiers( event.xkey.state );
|
||||
fgState.Modifiers = fgPlatformGetModifiers( event.xkey.state );
|
||||
keyboard_cb( asciiCode[ 0 ],
|
||||
event.xkey.x, event.xkey.y
|
||||
);
|
||||
@ -1385,7 +1385,7 @@ void fghProcessSingleEvent ( void )
|
||||
if( special_cb && (special != -1) )
|
||||
{
|
||||
fgSetWindow( window );
|
||||
fgState.Modifiers = fghGetModifiers( event.xkey.state );
|
||||
fgState.Modifiers = fgPlatformGetModifiers( event.xkey.state );
|
||||
special_cb( special, event.xkey.x, event.xkey.y );
|
||||
fgState.Modifiers = INVALID_MODIFIERS;
|
||||
}
|
||||
@ -1412,7 +1412,7 @@ void fghProcessSingleEvent ( void )
|
||||
}
|
||||
|
||||
|
||||
static void fghMainLoopPreliminaryWork ( void )
|
||||
static void fgPlatformMainLoopPreliminaryWork ( void )
|
||||
{
|
||||
}
|
||||
#endif
|
||||
@ -1424,7 +1424,7 @@ static void fghMainLoopPreliminaryWork ( void )
|
||||
*/
|
||||
void FGAPIENTRY glutMainLoopEvent( void )
|
||||
{
|
||||
fghProcessSingleEvent ();
|
||||
fgPlatformProcessSingleEvent ();
|
||||
|
||||
if( fgState.Timers.First )
|
||||
fghCheckTimers( );
|
||||
@ -1444,7 +1444,7 @@ void FGAPIENTRY glutMainLoop( void )
|
||||
|
||||
FREEGLUT_EXIT_IF_NOT_INITIALISED ( "glutMainLoop" );
|
||||
|
||||
fghMainLoopPreliminaryWork ();
|
||||
fgPlatformMainLoopPreliminaryWork ();
|
||||
|
||||
fgState.ExecState = GLUT_EXEC_STATE_RUNNING ;
|
||||
while( fgState.ExecState == GLUT_EXEC_STATE_RUNNING )
|
||||
|
@ -85,7 +85,7 @@ static float menu_pen_hback [4] = {1.0f, 1.0f, 1.0f, 1.0f};
|
||||
#endif
|
||||
|
||||
|
||||
extern GLvoid fghGetGameModeVMaxExtent( SFG_Window* window, int* x, int* y );
|
||||
extern GLvoid fgPlatformGetGameModeVMaxExtent( SFG_Window* window, int* x, int* y );
|
||||
|
||||
/* -- PRIVATE FUNCTIONS ---------------------------------------------------- */
|
||||
|
||||
@ -143,7 +143,7 @@ static void fghDeactivateSubMenu( SFG_MenuEntry *menuEntry )
|
||||
* Private function to get the virtual maximum screen extent
|
||||
*/
|
||||
#if TARGET_HOST_POSIX_X11
|
||||
static GLvoid fghGetGameModeVMaxExtent( SFG_Window* window, int* x, int* y )
|
||||
static GLvoid fgPlatformGetGameModeVMaxExtent( SFG_Window* window, int* x, int* y )
|
||||
{
|
||||
int wx, wy;
|
||||
Window w;
|
||||
@ -163,7 +163,7 @@ static GLvoid fghGetGameModeVMaxExtent( SFG_Window* window, int* x, int* y )
|
||||
static GLvoid fghGetVMaxExtent( SFG_Window* window, int* x, int* y )
|
||||
{
|
||||
if( fgStructure.GameModeWindow )
|
||||
fghGetGameModeVMaxExtent ( window, x, y );
|
||||
fgPlatformGetGameModeVMaxExtent ( window, x, y );
|
||||
else
|
||||
{
|
||||
*x = fgDisplay.ScreenWidth;
|
||||
|
@ -14,7 +14,7 @@
|
||||
#include <X11/extensions/XInput2.h>
|
||||
|
||||
/* import function from freeglut_main.c */
|
||||
int fghGetModifiers( int state );
|
||||
extern int fgPlatformGetModifiers( int state );
|
||||
|
||||
/* extension opcode for XInput */
|
||||
int xi_opcode = -1;
|
||||
@ -160,7 +160,7 @@ void fgHandleExtensionEvents( XEvent* base_ev ) {
|
||||
|
||||
case XI_Enter:
|
||||
case XI_Leave:
|
||||
fgState.Modifiers = fghGetModifiers( ((XIEnterEvent*)event)->mods.base );
|
||||
fgState.Modifiers = fgPlatformGetModifiers( ((XIEnterEvent*)event)->mods.base );
|
||||
INVOKE_WCB( *window, MultiEntry, (
|
||||
event->deviceid,
|
||||
(event->evtype == XI_Enter ? GLUT_ENTERED : GLUT_LEFT)
|
||||
@ -172,7 +172,7 @@ void fgHandleExtensionEvents( XEvent* base_ev ) {
|
||||
|
||||
case XI_ButtonPress:
|
||||
case XI_ButtonRelease:
|
||||
fgState.Modifiers = fghGetModifiers( event->mods.base );
|
||||
fgState.Modifiers = fgPlatformGetModifiers( event->mods.base );
|
||||
INVOKE_WCB( *window, MultiButton, (
|
||||
event->deviceid,
|
||||
event->event_x,
|
||||
@ -189,7 +189,7 @@ void fgHandleExtensionEvents( XEvent* base_ev ) {
|
||||
break;
|
||||
|
||||
case XI_Motion:
|
||||
fgState.Modifiers = fghGetModifiers( event->mods.base );
|
||||
fgState.Modifiers = fgPlatformGetModifiers( event->mods.base );
|
||||
for (i = 0; i < event->buttons.mask_len; i++) if (event->buttons.mask[i]) button = 1;
|
||||
if (button) {
|
||||
INVOKE_WCB( *window, MultiMotion, ( event->deviceid, event->event_x, event->event_y ) );
|
||||
|
@ -30,7 +30,7 @@
|
||||
|
||||
|
||||
|
||||
void fghSetCursor ( SFG_Window *window, int cursorID )
|
||||
void fgPlatformSetCursor ( SFG_Window *window, int cursorID )
|
||||
{
|
||||
/*
|
||||
* Joe Krahn is re-writing the following code.
|
||||
@ -101,7 +101,7 @@ void fghSetCursor ( SFG_Window *window, int cursorID )
|
||||
}
|
||||
|
||||
|
||||
void fghWarpPointer ( int x, int y )
|
||||
void fgPlatformWarpPointer ( int x, int y )
|
||||
{
|
||||
POINT coords;
|
||||
coords.x = x;
|
||||
|
@ -28,7 +28,7 @@
|
||||
#include <GL/freeglut.h>
|
||||
#include "freeglut_internal_mswin.h"
|
||||
|
||||
GLUTproc fghGetPlatformSpecificGLUTProcAddress( const char* procName )
|
||||
GLUTproc fgPlatformGlutGetProcAddress( const char* procName )
|
||||
{
|
||||
#if !defined(_WIN32_WCE)
|
||||
/* optimization: quick initial check */
|
||||
|
@ -32,7 +32,7 @@
|
||||
* Remembers the current visual settings, so that
|
||||
* we can change them and restore later...
|
||||
*/
|
||||
void fghRememberState( void )
|
||||
void fgPlatformRememberState( void )
|
||||
{
|
||||
/* DEVMODE devMode; */
|
||||
|
||||
@ -53,7 +53,7 @@ void fghRememberState( void )
|
||||
/*
|
||||
* Restores the previously remembered visual settings
|
||||
*/
|
||||
void fghRestoreState( void )
|
||||
void fgPlatformRestoreState( void )
|
||||
{
|
||||
/* Restore the previously remembered desktop display settings */
|
||||
ChangeDisplaySettingsEx( fgDisplay.DisplayName,&fgDisplay.DisplayMode, 0,0,0 );
|
||||
@ -66,7 +66,7 @@ void fghRestoreState( void )
|
||||
/*
|
||||
* Changes the current display mode to match user's settings
|
||||
*/
|
||||
GLboolean fghChangeDisplayMode( GLboolean haveToTest )
|
||||
GLboolean fgPlatformChangeDisplayMode( GLboolean haveToTest )
|
||||
{
|
||||
GLboolean success = GL_FALSE;
|
||||
DEVMODE devMode;
|
||||
|
@ -32,7 +32,7 @@
|
||||
/*
|
||||
* A call to this function should initialize all the display stuff...
|
||||
*/
|
||||
void fghInitialize( const char* displayName )
|
||||
void fgPlatformInitialize( const char* displayName )
|
||||
{
|
||||
WNDCLASS wc;
|
||||
ATOM atom;
|
||||
@ -54,7 +54,7 @@ void fghInitialize( const char* displayName )
|
||||
* XXX Old code had "| CS_DBCLCKS" commented out. Plans for the
|
||||
* XXX future? Dead-end idea?
|
||||
*/
|
||||
wc.lpfnWndProc = fgWindowProc;
|
||||
wc.lpfnWndProc = fgPlatformWindowProc;
|
||||
wc.cbClsExtra = 0;
|
||||
wc.cbWndExtra = 0;
|
||||
wc.hInstance = fgDisplay.Instance;
|
||||
@ -75,7 +75,7 @@ void fghInitialize( const char* displayName )
|
||||
|
||||
/* Register the window class */
|
||||
atom = RegisterClass( &wc );
|
||||
FREEGLUT_INTERNAL_ERROR_EXIT ( atom, "Window Class Not Registered", "fghInitialize" );
|
||||
FREEGLUT_INTERNAL_ERROR_EXIT ( atom, "Window Class Not Registered", "fgPlatformInitialize" );
|
||||
}
|
||||
|
||||
/* The screen dimensions can be obtained via GetSystemMetrics() calls */
|
||||
@ -104,7 +104,7 @@ void fghInitialize( const char* displayName )
|
||||
DeleteDC(context);
|
||||
}
|
||||
else
|
||||
fgWarning("fghInitialize: "
|
||||
fgWarning("fgPlatformInitialize: "
|
||||
"CreateDC failed, Screen size info may be incorrect\n"
|
||||
"This is quite likely caused by a bad '-display' parameter");
|
||||
|
||||
@ -131,7 +131,7 @@ void fghInitialize( const char* displayName )
|
||||
/* Platform-Specific Deinitialization Functions: */
|
||||
extern void fghCloseInputDevices ( void );
|
||||
|
||||
void fghDeinitialiseInputDevices ( void )
|
||||
void fgPlatformDeinitialiseInputDevices ( void )
|
||||
{
|
||||
#if !defined(_WIN32_WCE)
|
||||
fghCloseInputDevices ();
|
||||
@ -140,7 +140,7 @@ void fghDeinitialiseInputDevices ( void )
|
||||
fgState.InputDevsInitialised = GL_FALSE;
|
||||
}
|
||||
|
||||
void fghCloseDisplay ( void )
|
||||
void fgPlatformCloseDisplay ( void )
|
||||
{
|
||||
if( fgDisplay.DisplayName )
|
||||
{
|
||||
|
@ -45,7 +45,7 @@ int serial_putchar ( SERIALPORT *port, unsigned char ch );
|
||||
void serial_flush ( SERIALPORT *port );
|
||||
|
||||
|
||||
void fghRegisterDialDevice ( const char *dial_device )
|
||||
void fgPlatformRegisterDialDevice ( const char *dial_device )
|
||||
{
|
||||
if (!dial_device){
|
||||
static char devname[256];
|
||||
|
@ -32,7 +32,7 @@
|
||||
extern void fghRedrawWindow ( SFG_Window *window );
|
||||
|
||||
|
||||
void fghPlatformReshapeWindow ( SFG_Window *window, int width, int height )
|
||||
void fgPlatformReshapeWindow ( SFG_Window *window, int width, int height )
|
||||
{
|
||||
RECT windowRect;
|
||||
|
||||
@ -80,7 +80,7 @@ void fghPlatformReshapeWindow ( SFG_Window *window, int width, int height )
|
||||
}
|
||||
|
||||
|
||||
void fghcbPlatformDisplayWindow ( SFG_Window *window )
|
||||
void fgPlatformDisplayWindow ( SFG_Window *window )
|
||||
{
|
||||
RedrawWindow(
|
||||
window->Window.Handle, NULL, NULL,
|
||||
@ -89,13 +89,13 @@ void fghcbPlatformDisplayWindow ( SFG_Window *window )
|
||||
}
|
||||
|
||||
|
||||
void fghPlatformSleepForEvents( long msec )
|
||||
void fgPlatformSleepForEvents( long msec )
|
||||
{
|
||||
MsgWaitForMultipleObjects( 0, NULL, FALSE, msec, QS_ALLINPUT );
|
||||
}
|
||||
|
||||
|
||||
void fghProcessSingleEvent ( void )
|
||||
void fgPlatformProcessSingleEvent ( void )
|
||||
{
|
||||
MSG stMsg;
|
||||
|
||||
@ -123,7 +123,7 @@ void fghProcessSingleEvent ( void )
|
||||
|
||||
|
||||
|
||||
void fghMainLoopPreliminaryWork ( void )
|
||||
void fgPlatformMainLoopPreliminaryWork ( void )
|
||||
{
|
||||
SFG_Window *window = (SFG_Window *)fgStructure.Windows.First ;
|
||||
|
||||
@ -154,7 +154,7 @@ void fghMainLoopPreliminaryWork ( void )
|
||||
/*
|
||||
* Determine a GLUT modifer mask based on MS-WINDOWS system info.
|
||||
*/
|
||||
static int fghGetModifiers (void)
|
||||
static int fgPlatformGetModifiers (void)
|
||||
{
|
||||
return
|
||||
( ( ( GetKeyState( VK_LSHIFT ) < 0 ) ||
|
||||
@ -168,8 +168,8 @@ static int fghGetModifiers (void)
|
||||
/*
|
||||
* The window procedure for handling Win32 events
|
||||
*/
|
||||
LRESULT CALLBACK fgWindowProc( HWND hWnd, UINT uMsg, WPARAM wParam,
|
||||
LPARAM lParam )
|
||||
LRESULT CALLBACK fgPlatformWindowProc( HWND hWnd, UINT uMsg, WPARAM wParam,
|
||||
LPARAM lParam )
|
||||
{
|
||||
static unsigned char lControl = 0, rControl = 0, lShift = 0,
|
||||
rShift = 0, lAlt = 0, rAlt = 0;
|
||||
@ -307,7 +307,7 @@ LRESULT CALLBACK fgWindowProc( HWND hWnd, UINT uMsg, WPARAM wParam,
|
||||
/* The window structure is passed as the creation structure parameter... */
|
||||
window = (SFG_Window *) (((LPCREATESTRUCT) lParam)->lpCreateParams);
|
||||
FREEGLUT_INTERNAL_ERROR_EXIT ( ( window != NULL ), "Cannot create window",
|
||||
"fgWindowProc" );
|
||||
"fgPlatformWindowProc" );
|
||||
|
||||
window->Window.Handle = hWnd;
|
||||
window->Window.Device = GetDC( hWnd );
|
||||
@ -497,7 +497,7 @@ LRESULT CALLBACK fgWindowProc( HWND hWnd, UINT uMsg, WPARAM wParam,
|
||||
}
|
||||
SetFocus(window->Window.Handle);
|
||||
|
||||
fgState.Modifiers = fghGetModifiers( );
|
||||
fgState.Modifiers = fgPlatformGetModifiers( );
|
||||
|
||||
if( ( wParam & MK_LBUTTON ) ||
|
||||
( wParam & MK_MBUTTON ) ||
|
||||
@ -607,7 +607,7 @@ LRESULT CALLBACK fgWindowProc( HWND hWnd, UINT uMsg, WPARAM wParam,
|
||||
break;
|
||||
|
||||
fgSetWindow( window );
|
||||
fgState.Modifiers = fghGetModifiers( );
|
||||
fgState.Modifiers = fgPlatformGetModifiers( );
|
||||
|
||||
INVOKE_WCB(
|
||||
*window, Mouse,
|
||||
@ -641,7 +641,7 @@ LRESULT CALLBACK fgWindowProc( HWND hWnd, UINT uMsg, WPARAM wParam,
|
||||
break;
|
||||
|
||||
fgSetWindow( window );
|
||||
fgState.Modifiers = fghGetModifiers( );
|
||||
fgState.Modifiers = fgPlatformGetModifiers( );
|
||||
|
||||
/*
|
||||
* XXX Should use WHEEL_DELTA instead of 120
|
||||
@ -702,7 +702,7 @@ LRESULT CALLBACK fgWindowProc( HWND hWnd, UINT uMsg, WPARAM wParam,
|
||||
* Remember the current modifiers state. This is done here in order
|
||||
* to make sure the VK_DELETE keyboard callback is executed properly.
|
||||
*/
|
||||
fgState.Modifiers = fghGetModifiers( );
|
||||
fgState.Modifiers = fgPlatformGetModifiers( );
|
||||
|
||||
GetCursorPos( &mouse_pos );
|
||||
ScreenToClient( window->Window.Handle, &mouse_pos );
|
||||
@ -792,7 +792,7 @@ LRESULT CALLBACK fgWindowProc( HWND hWnd, UINT uMsg, WPARAM wParam,
|
||||
* Remember the current modifiers state. This is done here in order
|
||||
* to make sure the VK_DELETE keyboard callback is executed properly.
|
||||
*/
|
||||
fgState.Modifiers = fghGetModifiers( );
|
||||
fgState.Modifiers = fgPlatformGetModifiers( );
|
||||
|
||||
GetCursorPos( &mouse_pos );
|
||||
ScreenToClient( window->Window.Handle, &mouse_pos );
|
||||
@ -877,7 +877,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) )
|
||||
break;
|
||||
|
||||
fgState.Modifiers = fghGetModifiers( );
|
||||
fgState.Modifiers = fgPlatformGetModifiers( );
|
||||
INVOKE_WCB( *window, Keyboard,
|
||||
( (char)wParam,
|
||||
window->State.MouseX, window->State.MouseY )
|
||||
|
@ -29,7 +29,7 @@
|
||||
#include "freeglut_internal_mswin.h"
|
||||
|
||||
|
||||
GLvoid fghGetGameModeVMaxExtent( SFG_Window* window, int* x, int* y )
|
||||
GLvoid fgPlatformGetGameModeVMaxExtent( SFG_Window* window, int* x, int* y )
|
||||
{
|
||||
*x = glutGet ( GLUT_SCREEN_WIDTH );
|
||||
*y = glutGet ( GLUT_SCREEN_HEIGHT );
|
||||
|
Reference in New Issue
Block a user