git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@14
7f0cb862-5218-0410-a997-
914c9d46530a
/*
* Grab the current desktop settings...
*/
/*
* 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 );
/*
EnumDisplaySettings( NULL, ENUM_CURRENT_SETTINGS, &fgDisplay.DisplayMode );
/*
- guint displayModes = 0, mode = 0xffffffff;
- gboolean success = FALSE;
+ unsigned int displayModes = 0, mode = 0xffffffff;
+ GLboolean success = FALSE;
HDC desktopDC;
DEVMODE devMode;
HDC desktopDC;
DEVMODE devMode;
/*
* Make sure the unitialized fields are reset to zero
/*
* Make sure the unitialized fields are reset to zero
/*
* Remember the function's call time
*/
/*
* Remember the function's call time
*/
gettimeofday(&fgState.Time.Value, NULL);
gettimeofday(&fgState.Time.Value, NULL);
+#else
+ fgState.Time.Value = timeGetTime();
+#endif
fgState.Time.Set = TRUE;
/*
fgState.Time.Set = TRUE;
/*
*/
long fgElapsedTime( void )
{
*/
long fgElapsedTime( void )
{
struct timeval now;
long elapsed;
struct timeval now;
long elapsed;
elapsed += (now.tv_sec - fgState.Time.Value.tv_sec) * 1000;
return( elapsed );
elapsed += (now.tv_sec - fgState.Time.Value.tv_sec) * 1000;
return( elapsed );
+#else
+ return (timeGetTime() - fgState.Time.Value);
+#endif
+ GLboolean bLoop = TRUE;
case WM_MBUTTONUP:
case WM_RBUTTONUP:
{
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
/*
* A mouse button has been pressed *or* released. Again, break off
case WM_SYSKEYDOWN:
case WM_KEYDOWN:
{
case WM_SYSKEYDOWN:
case WM_KEYDOWN:
{
/*
* First of all, make sure that there is a window to be notified of this
/*
* 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
* 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;
{
PIXELFORMATDESCRIPTOR* ppfd, pfd;
- gint flags, pixelformat;
+ int flags, pixelformat;
/*
* Check if the window seems valid
/*
* Check if the window seems valid
#elif TARGET_HOST_WIN32
WNDCLASS wc;
#elif TARGET_HOST_WIN32
WNDCLASS wc;
* Grab the window class we have registered on glutInit():
*/
atom = GetClassInfo( fgDisplay.Instance, "FREEGLUT", &wc );
* Grab the window class we have registered on glutInit():
*/
atom = GetClassInfo( fgDisplay.Instance, "FREEGLUT", &wc );
if( gameMode == FALSE )
{
if( gameMode == FALSE )
{
/*
* In game mode, the story is a little bit different...
*/
/*
* 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:
/*
* Set the window creation flags appropriately to make the window entirely visible:
/*
* Make sure window was created
*/
/*
* 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.
/*
* Show and update the main window. Hide the mouse cursor.