/*
* Grab the current desktop settings...
*/
+
+/* hack to get around my stupid cross-gcc headers */
+#define ENUM_CURRENT_SETTINGS -1
+
EnumDisplaySettings( NULL, ENUM_CURRENT_SETTINGS, &fgDisplay.DisplayMode );
/*
#elif TARGET_HOST_WIN32
- guint displayModes = 0, mode = 0xffffffff;
- gboolean success = FALSE;
+ unsigned int displayModes = 0, mode = 0xffffffff;
+ GLboolean success = FALSE;
HDC desktopDC;
DEVMODE devMode;
*/
if( atom == 0 )
{
- gboolean retval;
+ GLboolean retval;
/*
* Make sure the unitialized fields are reset to zero
/*
* Remember the function's call time
*/
+#ifndef WIN32
gettimeofday(&fgState.Time.Value, NULL);
+#else
+ fgState.Time.Value = timeGetTime();
+#endif
fgState.Time.Set = TRUE;
/*
*/
long fgElapsedTime( void )
{
+#ifndef WIN32
struct timeval now;
long elapsed;
elapsed += (now.tv_sec - fgState.Time.Value.tv_sec) * 1000;
return( elapsed );
+#else
+ return (timeGetTime() - fgState.Time.Value);
+#endif
}
/*
#elif TARGET_HOST_WIN32
- gboolean bLoop = TRUE;
+ GLboolean bLoop = TRUE;
MSG stMsg;
/*
case WM_MBUTTONUP:
case WM_RBUTTONUP:
{
- gboolean pressed = TRUE;
- gint button;
+ GLboolean pressed = TRUE;
+ int button;
/*
* A mouse button has been pressed *or* released. Again, break off
case WM_SYSKEYDOWN:
case WM_KEYDOWN:
{
- gint keypress = -1;
+ int keypress = -1;
/*
* First of all, make sure that there is a window to be notified of this
* Setup the pixel format for a Win32 window
*/
#if TARGET_HOST_WIN32
-gboolean fgSetupPixelFormat( SFG_Window* window, gboolean checkOnly )
+GLboolean fgSetupPixelFormat( SFG_Window* window, GLboolean checkOnly )
{
PIXELFORMATDESCRIPTOR* ppfd, pfd;
- gint flags, pixelformat;
+ int flags, pixelformat;
/*
* Check if the window seems valid
#elif TARGET_HOST_WIN32
WNDCLASS wc;
- gint flags;
+ int flags;
ATOM atom;
HWND hWnd;
* Grab the window class we have registered on glutInit():
*/
atom = GetClassInfo( fgDisplay.Instance, "FREEGLUT", &wc );
- g_assert( atom != 0 );
+ assert( atom != 0 );
if( gameMode == FALSE )
{
/*
* In game mode, the story is a little bit different...
*/
- g_assert( window->Parent == NULL );
+ assert( window->Parent == NULL );
/*
* Set the window creation flags appropriately to make the window entirely visible:
/*
* Make sure window was created
*/
- g_assert( window->Window.Handle != NULL );
+ assert( window->Window.Handle != NULL );
/*
* Show and update the main window. Hide the mouse cursor.