4 * Window management methods.
6 * Copyright (c) 1999-2000 Pawel W. Olszta. All Rights Reserved.
7 * Written by Pawel W. Olszta, <olszta@sourceforge.net>
8 * Creation date: Fri Dec 3 1999
10 * Permission is hereby granted, free of charge, to any person obtaining a
11 * copy of this software and associated documentation files (the "Software"),
12 * to deal in the Software without restriction, including without limitation
13 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
14 * and/or sell copies of the Software, and to permit persons to whom the
15 * Software is furnished to do so, subject to the following conditions:
17 * The above copyright notice and this permission notice shall be included
18 * in all copies or substantial portions of the Software.
20 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
21 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
23 * PAWEL W. OLSZTA BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
24 * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
25 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
32 #define G_LOG_DOMAIN "freeglut-window"
34 #include "../include/GL/freeglut.h"
35 #include "freeglut_internal.h"
38 * TODO BEFORE THE STABLE RELEASE:
40 * fgChooseVisual() -- OK, but what about glutInitDisplayString()?
41 * fgSetupPixelFormat -- ignores the display mode settings
42 * fgOpenWindow() -- check the Win32 version, -iconic handling!
43 * fgCloseWindow() -- check the Win32 version
44 * glutCreateWindow() -- see what happens when default position and size is {-1,-1}
45 * glutCreateSubWindow() -- see what happens when default position and size is {-1,-1}
46 * glutDestroyWindow() -- check the Win32 version
47 * glutSetWindow() -- check the Win32 version
48 * glutGetWindow() -- OK
49 * glutSetWindowTitle() -- check the Win32 version
50 * glutSetIconTitle() -- check the Win32 version
51 * glutShowWindow() -- check the Win32 version
52 * glutHideWindow() -- check the Win32 version
53 * glutIconifyWindow() -- check the Win32 version
54 * glutReshapeWindow() -- check the Win32 version
55 * glutPositionWindow() -- check the Win32 version
56 * glutPushWindow() -- check the Win32 version
57 * glutPopWindow() -- check the Win32 version
60 /* -- PRIVATE FUNCTIONS ---------------------------------------------------- */
63 * Chooses a visual basing on the current display mode settings
65 #if TARGET_HOST_UNIX_X11
66 XVisualInfo* fgChooseVisual( void )
68 int bufferSize[] = { 16, 12, 8, 4, 2, 1 };
69 GLboolean wantIndexedMode = FALSE;
74 * First we have to process the display mode settings...
76 # define ATTRIB(a) attributes[where++]=a;
79 * Decide if we want a true or indexed color visual:
81 if( !(fgState.DisplayMode & GLUT_INDEX) )
84 * We are sure that there will be R, B and B components requested:
87 ATTRIB( GLX_RED_SIZE ); ATTRIB( 1 );
88 ATTRIB( GLX_GREEN_SIZE ); ATTRIB( 1 );
89 ATTRIB( GLX_BLUE_SIZE ); ATTRIB( 1 );
92 * Check if the A component is required, too:
94 if( fgState.DisplayMode & GLUT_ALPHA )
96 ATTRIB( GLX_ALPHA_SIZE ); ATTRIB( 1 );
102 * We've got an indexed color request
104 ATTRIB( GLX_BUFFER_SIZE ); ATTRIB( 8 );
107 * Set the 'I want indexed mode' switch
109 wantIndexedMode = TRUE;
113 * We can have double or single buffered contexts created
115 if( fgState.DisplayMode & GLUT_DOUBLE )
117 ATTRIB( GLX_DOUBLEBUFFER );
121 * Stereoscopy seems a nice thing to have
123 if( fgState.DisplayMode & GLUT_STEREO )
125 ATTRIB( GLX_STEREO );
129 * Depth buffer is almost always required
131 if( fgState.DisplayMode & GLUT_DEPTH )
133 ATTRIB( GLX_DEPTH_SIZE ); ATTRIB( 1 );
139 if( fgState.DisplayMode & GLUT_STENCIL )
141 ATTRIB( GLX_STENCIL_SIZE ); ATTRIB( 1 );
145 * And finally the accumulation buffers
147 if( fgState.DisplayMode & GLUT_ACCUM )
149 ATTRIB( GLX_ACCUM_RED_SIZE ); ATTRIB( 1 );
150 ATTRIB( GLX_ACCUM_GREEN_SIZE ); ATTRIB( 1 );
151 ATTRIB( GLX_ACCUM_BLUE_SIZE ); ATTRIB( 1 );
154 * Check if the A component is required, too:
156 if( fgState.DisplayMode & GLUT_ALPHA )
158 ATTRIB( GLX_ACCUM_ALPHA_SIZE ); ATTRIB( 1 );
163 * Push a null at the end of the list
168 * OKi now, we've got two cases -- RGB(A) and index mode visuals
170 if( wantIndexedMode == FALSE )
173 * The easier one. And more common, too.
175 return( glXChooseVisual( fgDisplay.Display, fgDisplay.Screen, attributes ) );
179 XVisualInfo* visualInfo;
183 * In indexed mode, we need to check how many bits of depth can we achieve
189 * The GLX_BUFFER_SIZE value comes always first, so:
191 attributes[ 1 ] = bufferSize[ i ];
194 * Check if such visual is possible
196 visualInfo = glXChooseVisual( fgDisplay.Display, fgDisplay.Screen, attributes );
199 * The buffer size are sorted in descendant order, so choose the first:
201 if( visualInfo != NULL )
202 return( visualInfo );
206 * If we are still here, it means that the visual info was not found
214 * Setup the pixel format for a Win32 window
216 #if TARGET_HOST_WIN32
217 GLboolean fgSetupPixelFormat( SFG_Window* window, GLboolean checkOnly, unsigned char layer_type )
219 PIXELFORMATDESCRIPTOR* ppfd, pfd;
220 int flags, pixelformat;
223 * Check if the window seems valid
225 freeglut_return_val_if_fail( window != NULL, 0 );
228 * The pixel format should allow us to draw to the window using OpenGL
230 flags = PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL;
233 * It might be the case for us to use double buffering
235 if( fgState.DisplayMode & GLUT_DOUBLE )
236 flags |= PFD_DOUBLEBUFFER;
239 * Specify which pixel format do we opt for...
241 # pragma message( "fgSetupPixelFormat(): there is still some work to do here!" )
243 pfd.nSize = sizeof(PIXELFORMATDESCRIPTOR);
246 pfd.iPixelType = PFD_TYPE_RGBA;
257 pfd.cAccumRedBits = 0;
258 pfd.cAccumGreenBits = 0;
259 pfd.cAccumBlueBits = 0;
260 pfd.cAccumAlphaBits = 0;
263 pfd.cStencilBits = 0;
266 pfd.cStencilBits = 8;
269 pfd.iLayerType = layer_type;
272 pfd.dwVisibleMask = 0;
273 pfd.dwDamageMask = 0;
276 * Fill in the color bits...
278 pfd.cColorBits = (BYTE) GetDeviceCaps( window->Window.Device, BITSPIXEL );
282 * Choose the pixel format that matches our demand
284 pixelformat = ChoosePixelFormat( window->Window.Device, ppfd );
285 if( pixelformat == 0 )
289 * We might have been called to check if the pixel format exists only
295 * Finally, set the window's pixel format
297 return ( SetPixelFormat( window->Window.Device, pixelformat, ppfd ) ) ;
302 * Sets the OpenGL context and the fgStructure "Current Window" pointer to the window
303 * structure passed in.
305 void fgSetWindow ( SFG_Window *window )
307 #if TARGET_HOST_UNIX_X11
309 * Make the selected window's GLX context the current one
313 window->Window.Handle,
314 window->Window.Context
317 #elif TARGET_HOST_WIN32
319 * Release the previous' context's device context
321 if( fgStructure.Window != NULL )
322 ReleaseDC( fgStructure.Window->Window.Handle, fgStructure.Window->Window.Device );
327 * We will care about releasing the device context later
329 window->Window.Device = GetDC( window->Window.Handle );
332 * Set the new current context:
335 window->Window.Device,
336 window->Window.Context
342 * Remember that we have changed the current window state
344 fgStructure.Window = window;
349 * Opens a window. Requires a SFG_Window object created and attached
350 * to the freeglut structure. OpenGL context is created here.
352 void fgOpenWindow( SFG_Window* window, const char* title, int x, int y, int w, int h, GLboolean gameMode, int isSubWindow )
354 #if TARGET_HOST_UNIX_X11
355 XSetWindowAttributes winAttr;
356 XTextProperty textProperty;
357 XSizeHints sizeHints;
361 freeglut_assert_ready;
364 * Here we are upon the stage. Have the visual selected.
366 window->Window.VisualInfo = fgChooseVisual();
367 assert( window->Window.VisualInfo != NULL );
370 * Have the windows attributes set
372 * HINT: the masks should be updated when adding/removing callbacks.
373 * This might speed up message processing. Is that true?
375 winAttr.event_mask = StructureNotifyMask | SubstructureNotifyMask | ExposureMask |
376 ButtonPressMask | ButtonReleaseMask | KeyPressMask | KeyRelease |
377 VisibilityChangeMask | EnterWindowMask | LeaveWindowMask |
378 PointerMotionMask | ButtonMotionMask;
379 winAttr.background_pixmap = None;
380 winAttr.background_pixel = 0;
381 winAttr.border_pixel = 0;
384 * The color map is required, too
386 winAttr.colormap = XCreateColormap(
387 fgDisplay.Display, fgDisplay.RootWindow,
388 window->Window.VisualInfo->visual, AllocNone
392 * This tells the XCreateWindow() what attributes are we supplying it with
394 mask = CWBackPixmap | CWBorderPixel | CWColormap | CWEventMask;
397 * Have the window created now
399 window->Window.Handle = XCreateWindow(
401 window->Parent == NULL ? fgDisplay.RootWindow : window->Parent->Window.Handle,
403 window->Window.VisualInfo->depth, InputOutput,
404 window->Window.VisualInfo->visual, mask,
409 * The GLX context creation, possibly trying the direct context rendering
411 window->Window.Context = glXCreateContext(
412 fgDisplay.Display, window->Window.VisualInfo,
413 NULL, fgState.ForceDirectContext | fgState.TryDirectContext
417 * Make sure the context is direct when the user wants it forced
419 if( fgState.ForceDirectContext && !glXIsDirect( fgDisplay.Display, window->Window.Context ) )
420 fgError( "unable to force direct context rendering for window '%s'", title );
423 * Set the new context as the current one. That's all about the window creation.
427 window->Window.Handle,
428 window->Window.Context
432 * Assume the new window is visible by default
434 window->State.Visible = TRUE;
437 * For the position and size hints -- make sure we are passing valid values
441 if (fgState.Position.Use == TRUE) sizeHints.flags |= USPosition;
442 if (fgState.Size.Use == TRUE) sizeHints.flags |= USSize;
445 * Fill in the size hints values now (the x, y, width and height
446 * settings are obsolote, are there any more WMs that support them?)
448 sizeHints.x = x; sizeHints.y = y;
449 sizeHints.width = w; sizeHints.height = h;
452 * We can have forced all new windows start in iconified state:
454 wmHints.flags = StateHint;
455 wmHints.initial_state = (fgState.ForceIconic == FALSE) ? NormalState : IconicState;
458 * Prepare the window and iconified window names...
460 XStringListToTextProperty( (char **) &title, 1, &textProperty );
463 * Set the window's properties now
467 window->Window.Handle,
478 * Make sure we are informed about the window deletion commands
480 XSetWMProtocols( fgDisplay.Display, window->Window.Handle, &fgDisplay.DeleteWindow, 1 );
483 * Finally, have the window mapped to our display
485 XMapWindow( fgDisplay.Display, window->Window.Handle );
488 * In game mode, move the viewport a bit to hide the decorations.
489 * This code depends on the XFree86 video mode extensions.
491 if( gameMode == TRUE )
494 * This somehow fixes the glutGet() GLUT_WINDOW_X and GLUT_WINDOW_Y problem...
496 XMoveWindow( fgDisplay.Display, window->Window.Handle, x, y );
498 # ifdef X_XF86VidModeSetViewPort
501 * Set the newly created window as the current one...
503 fgSetWindow( window );
506 * Move the viewport a bit down and right from top-left corner to hide the decorations
508 XF86VidModeSetViewPort(
511 glutGet( GLUT_WINDOW_X ),
512 glutGet( GLUT_WINDOW_Y )
518 #elif TARGET_HOST_WIN32
524 freeglut_assert_ready;
527 * Grab the window class we have registered on glutInit():
529 atom = GetClassInfo( fgDisplay.Instance, "FREEGLUT", &wc );
532 if( gameMode == FALSE )
537 * Update the window position and dimensions, taking account of window decorations
540 x -= (GetSystemMetrics( SM_CXSIZEFRAME ) );
541 y -= (GetSystemMetrics( SM_CYSIZEFRAME ) + GetSystemMetrics( SM_CYCAPTION ) );
543 w += (GetSystemMetrics( SM_CXSIZEFRAME ) )*2;
544 h += (GetSystemMetrics( SM_CYSIZEFRAME ) )*2 + GetSystemMetrics( SM_CYCAPTION );
548 * Check if the user wants us to use the default position/size
550 if( fgState.Position.Use == FALSE ) { x = CW_USEDEFAULT; y = CW_USEDEFAULT; }
551 if( fgState.Size .Use == FALSE ) { w = CW_USEDEFAULT; h = CW_USEDEFAULT; }
554 * There's a small difference between creating the top, child and game mode windows
556 flags = WS_CLIPSIBLINGS | WS_CLIPCHILDREN | WS_VISIBLE;
558 if( window->Parent == NULL )
559 flags |= WS_OVERLAPPEDWINDOW;
566 * In game mode, the story is a little bit different...
568 assert( window->Parent == NULL );
571 * Set the window creation flags appropriately to make the window entirely visible:
573 flags = WS_POPUP | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | WS_VISIBLE;
577 * Create the window now, passing the freeglut window structure as the parameter
579 window->Window.Handle = CreateWindow(
584 (HWND) window->Parent == NULL ? NULL : window->Parent->Window.Handle,
591 * Make sure window was created
593 assert( window->Window.Handle != NULL );
596 * Show and update the main window. Hide the mouse cursor.
598 ShowWindow( window->Window.Handle, fgState.ForceIconic ? SW_SHOWMINIMIZED : SW_SHOW );
599 UpdateWindow( window->Window.Handle );
605 * Set the newly created window as the current one
607 fgSetWindow( window );
611 * Closes a window, destroying the frame and OpenGL context
613 void fgCloseWindow( SFG_Window* window )
615 freeglut_assert_ready;
617 #if TARGET_HOST_UNIX_X11
619 * As easy as kill bunnies with axes. Destroy the context first:
621 glXDestroyContext( fgDisplay.Display, window->Window.Context );
624 * Then have the window killed:
626 XDestroyWindow( fgDisplay.Display, window->Window.Handle );
629 * Finally, flush the rests down the stream
631 XFlush( fgDisplay.Display );
633 #elif TARGET_HOST_WIN32
635 * Send the WM_CLOSE message to the window now
638 window->Window.Handle,
648 /* -- INTERFACE FUNCTIONS -------------------------------------------------- */
651 * Creates a new top-level freeglut window
653 int FGAPIENTRY glutCreateWindow( const char* title )
656 * Create a new window and return its unique ID number
658 return( fgCreateWindow( NULL, title, fgState.Position.X, fgState.Position.Y,
659 fgState.Size.X, fgState.Size.Y, FALSE )->ID );
663 * This function creates a sub window.
665 int FGAPIENTRY glutCreateSubWindow( int parentID, int x, int y, int w, int h )
667 SFG_Window* window = NULL;
668 SFG_Window* parent = NULL;
670 freeglut_assert_ready;
673 * Find a parent to the newly created window...
675 parent = fgWindowByID( parentID );
678 * Fail if the parent has not been found
680 freeglut_return_val_if_fail( parent != NULL, 0 );
683 * Create the new window
685 window = fgCreateWindow( parent, "", x, y, w, h, FALSE );
688 * Return the new window's ID
690 return( window->ID );
694 * Destroys a window and all of its subwindows
696 void FGAPIENTRY glutDestroyWindow( int windowID )
698 fgExecutionState ExecState = fgState.ExecState ;
701 * Grab the freeglut window pointer from the structure
703 SFG_Window* window = fgWindowByID( windowID );
704 freeglut_return_if_fail( window != NULL );
707 * There is a function that performs all needed steps
708 * defined in freeglut_structure.c. Let's use it:
710 fgAddToWindowDestroyList( window, TRUE );
713 * Since the "fgAddToWindowDestroyList" function could easily have set the "ExecState"
714 * to stop, let's set it back to what it was.
716 fgState.ExecState = ExecState ;
720 * This function selects the current window
722 void FGAPIENTRY glutSetWindow( int ID )
724 SFG_Window* window = NULL;
727 * Make sure we don't get called too early
729 freeglut_assert_ready;
732 * Be wise. Be wise. Be wise. Be quick.
734 if( fgStructure.Window != NULL )
735 if( fgStructure.Window->ID == ID )
739 * Now we are sure there is sense in looking for the window
741 window = fgWindowByID( ID );
744 * In the case of an utter failure...
749 * ...issue a warning message and keep rolling on
751 fgWarning( "glutSetWindow(): window ID %i not found!", ID );
755 fgSetWindow ( window ) ;
759 * This function returns the ID number of the current window, 0 if none exists
761 int FGAPIENTRY glutGetWindow( void )
763 freeglut_assert_ready;
766 * Do we have a current window selected?
768 if( fgStructure.Window == NULL )
771 * Nope. Return zero to mark the state.
777 * Otherwise, return the ID of the current window
779 return( fgStructure.Window->ID );
783 * This function makes the current window visible
785 void FGAPIENTRY glutShowWindow( void )
787 freeglut_assert_ready; freeglut_assert_window;
789 #if TARGET_HOST_UNIX_X11
791 * Showing the window is done via mapping under X
793 XMapWindow( fgDisplay.Display, fgStructure.Window->Window.Handle );
794 XFlush( fgDisplay.Display );
796 #elif TARGET_HOST_WIN32
798 * Restore the window's originial position and size
800 ShowWindow( fgStructure.Window->Window.Handle, SW_SHOW );
806 * This function hides the current window
808 void FGAPIENTRY glutHideWindow( void )
810 freeglut_assert_ready; freeglut_assert_window;
812 #if TARGET_HOST_UNIX_X11
814 * The way we hide a window depends on if we're dealing
815 * with a top-level or children one...
817 if( fgStructure.Window->Parent == NULL )
820 * This is a top-level window
822 XWithdrawWindow( fgDisplay.Display, fgStructure.Window->Window.Handle, fgDisplay.Screen );
827 * Nope, it's a child window
829 XUnmapWindow( fgDisplay.Display, fgStructure.Window->Window.Handle );
833 * Flush the X state now
835 XFlush( fgDisplay.Display );
837 #elif TARGET_HOST_WIN32
841 ShowWindow( fgStructure.Window->Window.Handle, SW_HIDE );
847 * Iconify the current window (top-level windows only)
849 void FGAPIENTRY glutIconifyWindow( void )
851 freeglut_assert_ready; freeglut_assert_window;
853 #if TARGET_HOST_UNIX_X11
855 * Iconify the window and flush the X state
857 XIconifyWindow( fgDisplay.Display, fgStructure.Window->Window.Handle, fgDisplay.Screen );
858 XFlush( fgDisplay.Display );
860 #elif TARGET_HOST_WIN32
862 * Minimize the current window (this should be the same as X window iconifying)
864 ShowWindow( fgStructure.Window->Window.Handle, SW_MINIMIZE );
870 * Set the current window's title
872 void FGAPIENTRY glutSetWindowTitle( const char* title )
874 freeglut_assert_ready; freeglut_assert_window;
877 * Works only for top-level windows
879 if( fgStructure.Window->Parent != NULL )
882 #if TARGET_HOST_UNIX_X11
887 * Prepare the text properties
889 text.value = (unsigned char *) title;
890 text.encoding = XA_STRING;
892 text.nitems = strlen( title );
899 fgStructure.Window->Window.Handle,
904 * Have the X display state flushed
906 XFlush( fgDisplay.Display );
909 #elif TARGET_HOST_WIN32
911 * This seems to be a bit easier under Win32
913 SetWindowText( fgStructure.Window->Window.Handle, title );
919 * Set the current window's iconified title
921 void FGAPIENTRY glutSetIconTitle( const char* title )
923 freeglut_assert_ready; freeglut_assert_window;
926 * Works only for top-level windows
928 if( fgStructure.Window->Parent != NULL )
931 #if TARGET_HOST_UNIX_X11
936 * Prepare the text properties
938 text.value = (unsigned char *) title;
939 text.encoding = XA_STRING;
941 text.nitems = strlen( title );
948 fgStructure.Window->Window.Handle,
953 * Have the X display state flushed
955 XFlush( fgDisplay.Display );
958 #elif TARGET_HOST_WIN32
960 * This seems to be a bit easier under Win32
962 SetWindowText( fgStructure.Window->Window.Handle, title );
968 * Change the current window's size
970 void FGAPIENTRY glutReshapeWindow( int width, int height )
972 freeglut_assert_ready; freeglut_assert_window;
974 #if TARGET_HOST_UNIX_X11
976 * Resize the window and flush the X state
978 XResizeWindow( fgDisplay.Display, fgStructure.Window->Window.Handle, width, height );
979 XFlush( fgDisplay.Display );
981 #elif TARGET_HOST_WIN32
987 * First off, grab the current window's position
989 GetWindowRect( fgStructure.Window->Window.Handle, &winRect );
993 if ( fgStructure.Window->Parent == NULL ) /* If this is not a subwindow ... */
996 * Adjust the size of the window to allow for the size of the frame
998 width += (GetSystemMetrics( SM_CXSIZEFRAME ) - 1)*2;
999 height += (GetSystemMetrics( SM_CYSIZEFRAME ) - 1)*2 + GetSystemMetrics( SM_CYCAPTION );
1001 else /* This is a subwindow, get the parent window's position and subtract it off */
1003 GetWindowRect ( fgStructure.Window->Parent->Window.Handle, &winRect ) ;
1004 x -= winRect.left + GetSystemMetrics( SM_CXSIZEFRAME ) ;
1005 y -= winRect.top + GetSystemMetrics( SM_CYSIZEFRAME ) + GetSystemMetrics( SM_CYCAPTION ) ;
1009 * Resize the window, forcing a redraw to happen
1012 fgStructure.Window->Window.Handle,
1024 * Change the current window's position
1026 void FGAPIENTRY glutPositionWindow( int x, int y )
1028 freeglut_assert_ready; freeglut_assert_window;
1030 #if TARGET_HOST_UNIX_X11
1032 * Reposition the window and flush the X state
1034 XMoveWindow( fgDisplay.Display, fgStructure.Window->Window.Handle, x, y );
1035 XFlush( fgDisplay.Display );
1037 #elif TARGET_HOST_WIN32
1042 * First off, grab the current window's position
1044 GetWindowRect( fgStructure.Window->Window.Handle, &winRect );
1046 if ( fgStructure.Window->Parent == NULL ) /* If this is not a subwindow ... */
1049 * Adjust the position of the window to allow for the size of the frame
1051 x -= (GetSystemMetrics( SM_CXSIZEFRAME ) - 1);
1052 y -= (GetSystemMetrics( SM_CYSIZEFRAME ) - 1 + GetSystemMetrics( SM_CYCAPTION ));
1053 if ( y < 0 ) y = 0 ;
1057 * Reposition the window, forcing a redraw to happen
1060 fgStructure.Window->Window.Handle,
1063 winRect.right - winRect.left,
1064 winRect.bottom - winRect.top,
1073 * Lowers the current window (by Z order change)
1075 void FGAPIENTRY glutPushWindow( void )
1077 freeglut_assert_ready; freeglut_assert_window;
1079 #if TARGET_HOST_UNIX_X11
1081 * Lower the current window
1083 XLowerWindow( fgDisplay.Display, fgStructure.Window->Window.Handle );
1085 #elif TARGET_HOST_WIN32
1087 * Set the new window's Z position, not affecting the rest of the settings:
1090 fgStructure.Window->Window.Handle,
1093 SWP_NOSIZE | SWP_NOMOVE
1100 * Raises the current window (by Z order change)
1102 void FGAPIENTRY glutPopWindow( void )
1104 freeglut_assert_ready; freeglut_assert_window;
1106 #if TARGET_HOST_UNIX_X11
1108 * Raise the current window
1110 XRaiseWindow( fgDisplay.Display, fgStructure.Window->Window.Handle );
1112 #elif TARGET_HOST_WIN32
1114 * Set the new window's Z position, not affecting the rest of the settings:
1117 fgStructure.Window->Window.Handle,
1120 SWP_NOSIZE | SWP_NOMOVE
1127 * Resize the current window so that it fits the whole screen
1129 void FGAPIENTRY glutFullScreen( void )
1131 freeglut_assert_ready; freeglut_assert_window;
1134 * Just have the window repositioned and resized
1136 glutPositionWindow( 0, 0 );
1139 fgDisplay.ScreenWidth,
1140 fgDisplay.ScreenHeight
1144 /*** END OF FILE ***/