* 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
* This might speed up message processing. Is that true?
*/
winAttr.event_mask = StructureNotifyMask | SubstructureNotifyMask | ExposureMask |
- ButtonPressMask | ButtonReleaseMask | KeyPressMask |
+ ButtonPressMask | ButtonReleaseMask | KeyPressMask | KeyRelease |
VisibilityChangeMask | EnterWindowMask | LeaveWindowMask |
PointerMotionMask | ButtonMotionMask;
winAttr.background_pixmap = None;
*/
sizeHints.flags = 0;
- sizeHints.flags |= (fgState.Position.Use == TRUE) ? USPosition : PPosition;
- sizeHints.flags |= (fgState.Size.Use == TRUE) ? USSize : PSize;
+ if (fgState.Position.Use == TRUE) sizeHints.flags |= USPosition;
+ if (fgState.Size.Use == TRUE) sizeHints.flags |= USSize;
/*
* Fill in the size hints values now (the x, y, width and height
XMapWindow( fgDisplay.Display, window->Window.Handle );
/*
- * This somehow fixes the glutGet() GLUT_WINDOW_X and GLUT_WINDOW_Y problem...
- */
- XMoveWindow( fgDisplay.Display, window->Window.Handle, x, y );
-
- /*
* In game mode, move the viewport a bit to hide the decorations.
* This code depends on the XFree86 video mode extensions.
*/
if( gameMode == TRUE )
{
+ /*
+ * This somehow fixes the glutGet() GLUT_WINDOW_X and GLUT_WINDOW_Y problem...
+ */
+ XMoveWindow( fgDisplay.Display, window->Window.Handle, x, y );
+
# ifdef X_XF86VidModeSetViewPort
/*
#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.