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 #include "../include/GL/freeglut.h"
33 #include "freeglut_internal.h"
36 * TODO BEFORE THE STABLE RELEASE:
38 * fgChooseVisual() -- OK, but what about glutInitDisplayString()?
39 * fgSetupPixelFormat -- ignores the display mode settings
40 * fgOpenWindow() -- check the Win32 version, -iconic handling!
41 * fgCloseWindow() -- check the Win32 version
42 * glutCreateWindow() -- Check when default position and size is {-1,-1}
43 * glutCreateSubWindow() -- Check when default position and size is {-1,-1}
44 * glutDestroyWindow() -- check the Win32 version
45 * glutSetWindow() -- check the Win32 version
46 * glutGetWindow() -- OK
47 * glutSetWindowTitle() -- check the Win32 version
48 * glutSetIconTitle() -- check the Win32 version
49 * glutShowWindow() -- check the Win32 version
50 * glutHideWindow() -- check the Win32 version
51 * glutIconifyWindow() -- check the Win32 version
52 * glutReshapeWindow() -- check the Win32 version
53 * glutPositionWindow() -- check the Win32 version
54 * glutPushWindow() -- check the Win32 version
55 * glutPopWindow() -- check the Win32 version
58 /* -- PRIVATE FUNCTIONS ---------------------------------------------------- */
61 * Chooses a visual basing on the current display mode settings
63 #if TARGET_HOST_UNIX_X11
65 XVisualInfo* fgChooseVisual( void )
67 #define BUFFER_SIZES 6
68 int bufferSize[BUFFER_SIZES] = { 16, 12, 8, 4, 2, 1 };
69 GLboolean wantIndexedMode = GL_FALSE;
74 * First we have to process the display mode settings...
77 * Why is there a semi-colon in this #define? The code
78 * that uses the macro seems to always add more semicolons...
80 #define ATTRIB(a) attributes[where++]=a;
81 #define ATTRIB_VAL(a,v) {ATTRIB(a); ATTRIB(v);}
83 if( fgState.DisplayMode & GLUT_INDEX )
85 ATTRIB_VAL( GLX_BUFFER_SIZE, 8 );
86 wantIndexedMode = GL_TRUE;
91 ATTRIB_VAL( GLX_RED_SIZE, 1 );
92 ATTRIB_VAL( GLX_GREEN_SIZE, 1 );
93 ATTRIB_VAL( GLX_BLUE_SIZE, 1 );
94 if( fgState.DisplayMode & GLUT_ALPHA )
95 ATTRIB_VAL( GLX_ALPHA_SIZE, 1 );
98 if( fgState.DisplayMode & GLUT_DOUBLE )
99 ATTRIB( GLX_DOUBLEBUFFER );
101 if( fgState.DisplayMode & GLUT_STEREO )
102 ATTRIB( GLX_STEREO );
104 if( fgState.DisplayMode & GLUT_DEPTH )
105 ATTRIB_VAL( GLX_DEPTH_SIZE, 1 );
107 if( fgState.DisplayMode & GLUT_STENCIL )
108 ATTRIB_VAL( GLX_STENCIL_SIZE, 1 );
110 if( fgState.DisplayMode & GLUT_ACCUM )
112 ATTRIB_VAL( GLX_ACCUM_RED_SIZE, 1 );
113 ATTRIB_VAL( GLX_ACCUM_GREEN_SIZE, 1 );
114 ATTRIB_VAL( GLX_ACCUM_BLUE_SIZE, 1 );
115 if( fgState.DisplayMode & GLUT_ALPHA )
116 ATTRIB_VAL( GLX_ACCUM_ALPHA_SIZE, 1 );
120 * Push a null at the end of the list
124 if( ! wantIndexedMode )
125 return glXChooseVisual( fgDisplay.Display, fgDisplay.Screen,
129 XVisualInfo* visualInfo;
133 * In indexed mode, we need to check how many bits of depth can we
134 * achieve. We do this by trying each possibility from the list
135 * given in the {bufferSize} array. If we match, we return to caller.
137 for( i=0; i<BUFFER_SIZES; i++ )
139 attributes[ 1 ] = bufferSize[ i ];
140 visualInfo = glXChooseVisual( fgDisplay.Display, fgDisplay.Screen,
142 if( visualInfo != NULL )
151 * Setup the pixel format for a Win32 window
153 #if TARGET_HOST_WIN32
154 GLboolean fgSetupPixelFormat( SFG_Window* window, GLboolean checkOnly,
155 unsigned char layer_type )
157 PIXELFORMATDESCRIPTOR* ppfd, pfd;
158 int flags, pixelformat;
160 freeglut_return_val_if_fail( window != NULL, 0 );
161 flags = PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL;
162 if( fgState.DisplayMode & GLUT_DOUBLE )
163 flags |= PFD_DOUBLEBUFFER;
165 #pragma message( "fgSetupPixelFormat(): there is still some work to do here!" )
168 * Specify which pixel format do we opt for...
170 pfd.nSize = sizeof(PIXELFORMATDESCRIPTOR);
173 pfd.iPixelType = PFD_TYPE_RGBA;
184 pfd.cAccumRedBits = 0;
185 pfd.cAccumGreenBits = 0;
186 pfd.cAccumBlueBits = 0;
187 pfd.cAccumAlphaBits = 0;
190 pfd.cStencilBits = 0;
193 pfd.cStencilBits = 8;
196 pfd.iLayerType = layer_type;
199 pfd.dwVisibleMask = 0;
200 pfd.dwDamageMask = 0;
202 pfd.cColorBits = (BYTE) GetDeviceCaps( window->Window.Device, BITSPIXEL );
205 pixelformat = ChoosePixelFormat( window->Window.Device, ppfd );
206 if( pixelformat == 0 )
211 return SetPixelFormat( window->Window.Device, pixelformat, ppfd );
216 * Sets the OpenGL context and the fgStructure "Current Window" pointer to
217 * the window structure passed in.
219 void fgSetWindow ( SFG_Window *window )
221 #if TARGET_HOST_UNIX_X11
225 window->Window.Handle,
226 window->Window.Context
228 #elif TARGET_HOST_WIN32
229 if( fgStructure.Window )
230 ReleaseDC( fgStructure.Window->Window.Handle,
231 fgStructure.Window->Window.Device );
235 window->Window.Device = GetDC( window->Window.Handle );
237 window->Window.Device,
238 window->Window.Context
242 fgStructure.Window = window;
247 * Opens a window. Requires a SFG_Window object created and attached
248 * to the freeglut structure. OpenGL context is created here.
250 void fgOpenWindow( SFG_Window* window, const char* title,
251 int x, int y, int w, int h,
252 GLboolean gameMode, GLboolean isSubWindow )
254 #if TARGET_HOST_UNIX_X11
255 XSetWindowAttributes winAttr;
256 XTextProperty textProperty;
257 XSizeHints sizeHints;
261 freeglut_assert_ready;
264 * XXX fgChooseVisual() is a common part of all three.
265 * XXX With a little thought, we should be able to greatly
268 if ( !window->IsMenu )
269 window->Window.VisualInfo = fgChooseVisual();
270 else if ( fgStructure.MenuContext )
271 window->Window.VisualInfo = fgChooseVisual();
274 unsigned int current_DisplayMode = fgState.DisplayMode ;
275 fgState.DisplayMode = GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH ;
276 window->Window.VisualInfo = fgChooseVisual();
277 fgState.DisplayMode = current_DisplayMode ;
280 if ( ! window->Window.VisualInfo )
283 * The "fgChooseVisual" returned a null meaning that the visual
284 * context is not available.
285 * Try a couple of variations to see if they will work.
287 if ( ! ( fgState.DisplayMode & GLUT_DOUBLE ) )
289 fgState.DisplayMode |= GLUT_DOUBLE ;
290 window->Window.VisualInfo = fgChooseVisual();
291 fgState.DisplayMode &= ~GLUT_DOUBLE ;
295 * GLUT also checks for multi-sampling, but I don't see that
296 * anywhere else in FREEGLUT so I won't bother with it for the moment.
300 assert( window->Window.VisualInfo != NULL );
303 * XXX HINT: the masks should be updated when adding/removing callbacks.
304 * XXX This might speed up message processing. Is that true?
306 * XXX A: Not appreciably, but it WILL make it easier to debug.
307 * XXX Try tracing old GLUT and try tracing freeglut. Old GLUT
308 * XXX turns off events that it doesn't need and is a whole lot
309 * XXX more pleasant to trace. (Hint: Think mouse-motion!)
311 * XXX It may make a difference in networked environments or on
312 * XXX some very slow systems, but I think that that is secondary
313 * XXX to making debugging easier.
315 winAttr.event_mask = StructureNotifyMask | SubstructureNotifyMask |
316 ExposureMask | ButtonPressMask | ButtonReleaseMask | KeyPressMask |
317 KeyRelease | VisibilityChangeMask | EnterWindowMask | LeaveWindowMask |
318 PointerMotionMask | ButtonMotionMask;
319 winAttr.background_pixmap = None;
320 winAttr.background_pixel = 0;
321 winAttr.border_pixel = 0;
323 winAttr.colormap = XCreateColormap(
324 fgDisplay.Display, fgDisplay.RootWindow,
325 window->Window.VisualInfo->visual, AllocNone
328 mask = CWBackPixmap | CWBorderPixel | CWColormap | CWEventMask;
330 if ( window->IsMenu )
332 winAttr.override_redirect = True;
333 mask |= CWOverrideRedirect;
336 window->Window.Handle = XCreateWindow(
338 window->Parent == NULL ? fgDisplay.RootWindow :
339 window->Parent->Window.Handle,
341 window->Window.VisualInfo->depth, InputOutput,
342 window->Window.VisualInfo->visual, mask,
347 * The GLX context creation, possibly trying the direct context rendering
348 * or else use the current context if the user has so specified
350 if ( window->IsMenu )
353 * If there isn't already an OpenGL rendering context for menu
356 if ( !fgStructure.MenuContext )
358 fgStructure.MenuContext =
359 (SFG_MenuContext *)malloc ( sizeof(SFG_MenuContext) );
360 fgStructure.MenuContext->VisualInfo = window->Window.VisualInfo;
361 fgStructure.MenuContext->Context = glXCreateContext(
362 fgDisplay.Display, fgStructure.MenuContext->VisualInfo,
363 NULL, fgState.ForceDirectContext | fgState.TryDirectContext
367 /* window->Window.Context = fgStructure.MenuContext->Context ; */
368 window->Window.Context = glXCreateContext(
369 fgDisplay.Display, window->Window.VisualInfo,
370 NULL, fgState.ForceDirectContext | fgState.TryDirectContext
373 else if ( fgState.UseCurrentContext )
375 window->Window.Context = glXGetCurrentContext();
377 if ( ! window->Window.Context )
378 window->Window.Context = glXCreateContext(
379 fgDisplay.Display, window->Window.VisualInfo,
380 NULL, fgState.ForceDirectContext | fgState.TryDirectContext
384 window->Window.Context = glXCreateContext(
385 fgDisplay.Display, window->Window.VisualInfo,
386 NULL, fgState.ForceDirectContext | fgState.TryDirectContext
389 if( fgState.ForceDirectContext &&
390 !glXIsDirect( fgDisplay.Display, window->Window.Context ) )
391 fgError( "unable to force direct context rendering for window '%s'",
396 window->Window.Handle,
397 window->Window.Context
401 * XXX Assume the new window is visible by default
402 * XXX Is this a safe assumption?
404 window->State.Visible = GL_TRUE;
407 if ( fgState.Position.Use )
408 sizeHints.flags |= USPosition;
409 if ( fgState.Size.Use )
410 sizeHints.flags |= USSize;
413 * Fill in the size hints values now (the x, y, width and height
414 * settings are obsolote, are there any more WMs that support them?)
415 * Unless the X servers actually stop supporting these, we should
416 * continue to fill them in. It is *not* our place to tell the user
417 * that they should replace a window manager that they like, and which
418 * works, just because *we* think that it's not "modern" enough.
423 sizeHints.height = h;
425 wmHints.flags = StateHint;
426 wmHints.initial_state = fgState.ForceIconic ? IconicState : NormalState;
429 * Prepare the window and iconified window names...
431 XStringListToTextProperty( (char **) &title, 1, &textProperty );
435 window->Window.Handle,
444 XSetWMProtocols( fgDisplay.Display, window->Window.Handle,
445 &fgDisplay.DeleteWindow, 1 );
446 XMapWindow( fgDisplay.Display, window->Window.Handle );
448 #elif TARGET_HOST_WIN32
454 freeglut_assert_ready;
457 * Grab the window class we have registered on glutInit():
459 atom = GetClassInfo( fgDisplay.Instance, "FREEGLUT", &wc );
464 assert( window->Parent == NULL );
467 * Set the window creation flags appropriately to make the window
470 flags = WS_POPUP | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | WS_VISIBLE;
474 if ( ( ! isSubWindow ) && ( ! window->IsMenu ) )
477 * Update the window dimensions, taking account of window
478 * decorations. "freeglut" is to create the window with the
479 * outside of its border at (x,y) and with dimensions (w,h).
481 w += (GetSystemMetrics( SM_CXSIZEFRAME ) )*2;
482 h += (GetSystemMetrics( SM_CYSIZEFRAME ) )*2 +
483 GetSystemMetrics( SM_CYCAPTION );
486 if( ! fgState.Position.Use )
491 if( ! fgState.Size.Use )
498 * There's a small difference between creating the top, child and
501 flags = WS_CLIPSIBLINGS | WS_CLIPCHILDREN | WS_VISIBLE;
503 if ( window->IsMenu )
505 else if( window->Parent == NULL )
506 flags |= WS_OVERLAPPEDWINDOW;
511 window->Window.Handle = CreateWindow(
516 (HWND) window->Parent == NULL ? NULL : window->Parent->Window.Handle,
521 if( !( window->Window.Handle ) )
522 fgError( "Failed to create a window (%s)!", title );
524 ShowWindow( window->Window.Handle,
525 fgState.ForceIconic ? SW_SHOWMINIMIZED : SW_SHOW );
526 UpdateWindow( window->Window.Handle );
527 ShowCursor( TRUE ); /* XXX Old comments say "hide cusror"! */
531 window->Window.DoubleBuffered =
532 ( fgState.DisplayMode & GLUT_DOUBLE ) ? 1 : 0;
534 if ( ! window->Window.DoubleBuffered )
536 glDrawBuffer ( GL_FRONT );
537 glReadBuffer ( GL_FRONT );
539 fgSetWindow( window );
543 * Closes a window, destroying the frame and OpenGL context
545 void fgCloseWindow( SFG_Window* window )
547 freeglut_assert_ready;
549 #if TARGET_HOST_UNIX_X11
551 glXDestroyContext( fgDisplay.Display, window->Window.Context );
552 XDestroyWindow( fgDisplay.Display, window->Window.Handle );
553 XFlush( fgDisplay.Display ); /* XXX Shouldn't need this */
555 #elif TARGET_HOST_WIN32
558 * Make sure we don't close a window with current context active
560 if( fgStructure.Window == window )
561 wglMakeCurrent( NULL, NULL );
564 * Step through the list of windows. If the rendering context
565 * is not being used by another window, then we delete it.
571 for( iter = (SFG_Window *)fgStructure.Windows.First;
573 iter = (SFG_Window *)iter->Node.Next )
575 if( ( iter->Window.Context == window->Window.Context ) &&
581 wglDeleteContext( window->Window.Context );
584 DestroyWindow( window->Window.Handle );
589 /* -- INTERFACE FUNCTIONS -------------------------------------------------- */
592 * Creates a new top-level freeglut window
594 int FGAPIENTRY glutCreateWindow( const char* title )
596 return fgCreateWindow( NULL, title, fgState.Position.X, fgState.Position.Y,
597 fgState.Size.X, fgState.Size.Y, GL_FALSE,
602 * This function creates a sub window.
604 int FGAPIENTRY glutCreateSubWindow( int parentID, int x, int y, int w, int h )
606 SFG_Window* window = NULL;
607 SFG_Window* parent = NULL;
609 freeglut_assert_ready;
610 parent = fgWindowByID( parentID );
611 freeglut_return_val_if_fail( parent != NULL, 0 );
612 window = fgCreateWindow( parent, "", x, y, w, h, GL_FALSE, GL_FALSE );
613 window->State.OldHeight = window->State.OldWidth = -1;
618 * Destroys a window and all of its subwindows
620 void FGAPIENTRY glutDestroyWindow( int windowID )
622 SFG_Window* window = fgWindowByID( windowID );
623 freeglut_return_if_fail( window != NULL );
625 fgExecutionState ExecState = fgState.ExecState;
626 fgAddToWindowDestroyList( window );
627 fgState.ExecState = ExecState;
632 * This function selects the current window
634 void FGAPIENTRY glutSetWindow( int ID )
636 SFG_Window* window = NULL;
638 freeglut_assert_ready;
639 if( fgStructure.Window != NULL )
640 if( fgStructure.Window->ID == ID )
643 window = fgWindowByID( ID );
646 fgWarning( "glutSetWindow(): window ID %i not found!", ID );
650 fgSetWindow( window );
654 * This function returns the ID number of the current window, 0 if none exists
656 int FGAPIENTRY glutGetWindow( void )
658 freeglut_assert_ready;
659 if( fgStructure.Window == NULL )
661 return fgStructure.Window->ID;
665 * This function makes the current window visible
667 void FGAPIENTRY glutShowWindow( void )
669 freeglut_assert_ready;
670 freeglut_assert_window;
672 #if TARGET_HOST_UNIX_X11
674 XMapWindow( fgDisplay.Display, fgStructure.Window->Window.Handle );
675 XFlush( fgDisplay.Display ); /* XXX Shouldn't need this */
677 #elif TARGET_HOST_WIN32
679 ShowWindow( fgStructure.Window->Window.Handle, SW_SHOW );
683 fgStructure.Window->State.Redisplay = GL_TRUE;
687 * This function hides the current window
689 void FGAPIENTRY glutHideWindow( void )
691 freeglut_assert_ready;
692 freeglut_assert_window;
694 #if TARGET_HOST_UNIX_X11
696 if( fgStructure.Window->Parent == NULL )
697 XWithdrawWindow( fgDisplay.Display, fgStructure.Window->Window.Handle,
700 XUnmapWindow( fgDisplay.Display, fgStructure.Window->Window.Handle );
701 XFlush( fgDisplay.Display ); /* XXX Shouldn't need this */
703 #elif TARGET_HOST_WIN32
705 ShowWindow( fgStructure.Window->Window.Handle, SW_HIDE );
709 fgStructure.Window->State.Redisplay = GL_FALSE;
713 * Iconify the current window (top-level windows only)
715 void FGAPIENTRY glutIconifyWindow( void )
717 freeglut_assert_ready;
718 freeglut_assert_window;
720 #if TARGET_HOST_UNIX_X11
722 XIconifyWindow( fgDisplay.Display, fgStructure.Window->Window.Handle,
724 XFlush( fgDisplay.Display ); /* XXX Shouldn't need this */
726 #elif TARGET_HOST_WIN32
728 ShowWindow( fgStructure.Window->Window.Handle, SW_MINIMIZE );
732 fgStructure.Window->State.Redisplay = GL_FALSE;
736 * Set the current window's title
738 void FGAPIENTRY glutSetWindowTitle( const char* title )
740 freeglut_assert_ready;
741 freeglut_assert_window;
742 if( fgStructure.Window->Parent != NULL )
745 #if TARGET_HOST_UNIX_X11
750 text.value = (unsigned char *) title;
751 text.encoding = XA_STRING;
753 text.nitems = strlen( title );
757 fgStructure.Window->Window.Handle,
761 XFlush( fgDisplay.Display ); /* XXX Shouldn't need this */
764 #elif TARGET_HOST_WIN32
766 SetWindowText( fgStructure.Window->Window.Handle, title );
773 * Set the current window's iconified title
775 void FGAPIENTRY glutSetIconTitle( const char* title )
777 freeglut_assert_ready;
778 freeglut_assert_window;
780 if( fgStructure.Window->Parent != NULL )
783 #if TARGET_HOST_UNIX_X11
788 text.value = (unsigned char *) title;
789 text.encoding = XA_STRING;
791 text.nitems = strlen( title );
795 fgStructure.Window->Window.Handle,
799 XFlush( fgDisplay.Display ); /* XXX Shouldn't need this */
802 #elif TARGET_HOST_WIN32
804 SetWindowText( fgStructure.Window->Window.Handle, title );
811 * Change the current window's size
813 void FGAPIENTRY glutReshapeWindow( int width, int height )
815 freeglut_assert_ready;
816 freeglut_assert_window;
818 fgStructure.Window->State.NeedToResize = GL_TRUE;
819 fgStructure.Window->State.Width = width ;
820 fgStructure.Window->State.Height = height;
824 * Change the current window's position
826 void FGAPIENTRY glutPositionWindow( int x, int y )
828 freeglut_assert_ready;
829 freeglut_assert_window;
831 #if TARGET_HOST_UNIX_X11
833 XMoveWindow( fgDisplay.Display, fgStructure.Window->Window.Handle, x, y );
834 XFlush( fgDisplay.Display ); /* XXX Shouldn't need this */
836 #elif TARGET_HOST_WIN32
841 GetWindowRect( fgStructure.Window->Window.Handle, &winRect );
843 fgStructure.Window->Window.Handle,
846 winRect.right - winRect.left,
847 winRect.bottom - winRect.top,
857 * Lowers the current window (by Z order change)
859 void FGAPIENTRY glutPushWindow( void )
861 freeglut_assert_ready;
862 freeglut_assert_window;
864 #if TARGET_HOST_UNIX_X11
866 XLowerWindow( fgDisplay.Display, fgStructure.Window->Window.Handle );
868 #elif TARGET_HOST_WIN32
871 fgStructure.Window->Window.Handle,
874 SWP_NOSIZE | SWP_NOMOVE
882 * Raises the current window (by Z order change)
884 void FGAPIENTRY glutPopWindow( void )
886 freeglut_assert_ready;
887 freeglut_assert_window;
889 #if TARGET_HOST_UNIX_X11
891 XRaiseWindow( fgDisplay.Display, fgStructure.Window->Window.Handle );
893 #elif TARGET_HOST_WIN32
896 fgStructure.Window->Window.Handle,
899 SWP_NOSIZE | SWP_NOMOVE
907 * Resize the current window so that it fits the whole screen
909 void FGAPIENTRY glutFullScreen( void )
911 freeglut_assert_ready;
912 freeglut_assert_window;
914 #if TARGET_HOST_UNIX_X11
921 fgStructure.Window->Window.Handle,
923 fgDisplay.ScreenWidth,
924 fgDisplay.ScreenHeight
927 XFlush( fgDisplay.Display ); /* This is needed */
929 XTranslateCoordinates(
931 fgStructure.Window->Window.Handle,
932 fgDisplay.RootWindow,
940 fgStructure.Window->Window.Handle,
943 XFlush( fgDisplay.Display ); /* XXX Shouldn't need this */
946 #elif TARGET_HOST_WIN32
948 fgStructure.Window->Window.Handle,
950 fgDisplay.ScreenWidth,
951 fgDisplay.ScreenHeight,
958 * A.Donev: Set and retrieve the window's user data
960 void* FGAPIENTRY glutGetWindowData( void )
962 return fgStructure.Window->UserData;
965 void FGAPIENTRY glutSetWindowData(void* data)
967 fgStructure.Window->UserData=data;
970 /*** END OF FILE ***/