\r
extern void fgPlatformReshapeWindow ( SFG_Window *window, int width, int height );\r
extern void fgPlatformDisplayWindow ( SFG_Window *window );\r
+extern unsigned long fgPlatformSystemTime ( void );\r
extern void fgPlatformSleepForEvents( long msec );\r
extern void fgPlatformProcessSingleEvent ( void );\r
extern void fgPlatformMainLoopPreliminaryWork ( void );\r
#if TARGET_HOST_POSIX_X11\r
void fgPlatformReshapeWindow ( SFG_Window *window, int width, int height )\r
{\r
- XResizeWindow( fgDisplay.Display, window->Window.Handle,\r
+ XResizeWindow( fgDisplay.pDisplay.Display, window->Window.Handle,\r
width, height );\r
- XFlush( fgDisplay.Display ); /* XXX Shouldn't need this */\r
+ XFlush( fgDisplay.pDisplay.Display ); /* XXX Shouldn't need this */\r
}\r
#endif\r
\r
{\r
fghRedrawWindow ( window ) ;\r
}\r
+\r
+\r
+unsigned long fgPlatformSystemTime ( void )\r
+{\r
+#if TARGET_HOST_SOLARIS || HAVE_GETTIMEOFDAY\r
+ struct timeval now;\r
+ gettimeofday( &now, NULL );\r
+ return now.tv_usec/1000 + now.tv_sec*1000;\r
+#endif\r
+}\r
#endif\r
\r
static void fghcbDisplayWindow( SFG_Window *window,\r
* when subtracting an initial start time, unless the total time exceeds\r
* 32-bit, where the GLUT API return value is also overflowed.\r
*/ \r
-unsigned long fgSystemTime(void) {\r
-#if TARGET_HOST_SOLARIS || HAVE_GETTIMEOFDAY\r
- struct timeval now;\r
- gettimeofday( &now, NULL );\r
- return now.tv_usec/1000 + now.tv_sec*1000;\r
-#elif TARGET_HOST_MS_WINDOWS\r
-# if defined(_WIN32_WCE)\r
- return GetTickCount();\r
-# else\r
- return timeGetTime();\r
-# endif\r
-#endif\r
+unsigned long fgSystemTime(void)\r
+{\r
+ return fgPlatformSystemTime ();\r
}\r
\r
/*\r
* need to allow that we may have an empty socket but non-\r
* empty event queue.\r
*/\r
- if( ! XPending( fgDisplay.Display ) )\r
+ if( ! XPending( fgDisplay.pDisplay.Display ) )\r
{\r
fd_set fdset;\r
int err;\r
int socket;\r
struct timeval wait;\r
\r
- socket = ConnectionNumber( fgDisplay.Display );\r
+ socket = ConnectionNumber( fgDisplay.pDisplay.Display );\r
FD_ZERO( &fdset );\r
FD_SET( socket, &fdset );\r
wait.tv_sec = msec / 1000;\r
\r
FREEGLUT_EXIT_IF_NOT_INITIALISED ( "glutMainLoopEvent" );\r
\r
- while( XPending( fgDisplay.Display ) )\r
+ while( XPending( fgDisplay.pDisplay.Display ) )\r
{\r
- XNextEvent( fgDisplay.Display, &event );\r
+ XNextEvent( fgDisplay.pDisplay.Display, &event );\r
#if _DEBUG\r
fghPrintEvent( &event );\r
#endif\r
break;\r
}\r
/* Destroy the window when the WM_DELETE_WINDOW message arrives */\r
- if( (Atom) event.xclient.data.l[ 0 ] == fgDisplay.DeleteWindow )\r
+ if( (Atom) event.xclient.data.l[ 0 ] == fgDisplay.pDisplay.DeleteWindow )\r
{\r
GETWINDOW( xclient );\r
\r
height = event.xconfigure.height;\r
}\r
\r
- if( ( width != window->State.OldWidth ) ||\r
- ( height != window->State.OldHeight ) )\r
+ if( ( width != window->State.pWState.OldWidth ) ||\r
+ ( height != window->State.pWState.OldHeight ) )\r
{\r
SFG_Window *current_window = fgStructure.CurrentWindow;\r
\r
- window->State.OldWidth = width;\r
- window->State.OldHeight = height;\r
+ window->State.pWState.OldWidth = width;\r
+ window->State.pWState.OldHeight = height;\r
if( FETCH_WCB( *window, Reshape ) )\r
INVOKE_WCB( *window, Reshape, ( width, height ) );\r
else\r
*/\r
\r
char keys[32];\r
- XQueryKeymap( fgDisplay.Display, keys ); /* Look at X11 keystate to detect repeat mode */\r
+ XQueryKeymap( fgDisplay.pDisplay.Display, keys ); /* Look at X11 keystate to detect repeat mode */\r
\r
if ( event.xkey.keycode<256 ) /* XQueryKeymap is limited to 256 keycodes */\r
{\r