e4968e96c6e5e7332620985d4730e8b58a43c91f
[freeglut] / freeglut-1.3 / freeglut_internal.h
1 /*
2  * freeglut_internal.h
3  *
4  * The freeglut library private include file.
5  *
6  * Copyright (c) 1999-2000 Pawel W. Olszta. All Rights Reserved.
7  * Written by Pawel W. Olszta, <olszta@sourceforge.net>
8  * Creation date: Thu Dec 2 1999
9  *
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:
16  *
17  * The above copyright notice and this permission notice shall be included
18  * in all copies or substantial portions of the Software.
19  *
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.
26  */
27
28 #ifndef  FREEGLUT_INTERNAL_H
29 #define  FREEGLUT_INTERNAL_H
30
31 /*
32  * Be sure to update these for every release!
33  */
34 #define VERSION_MAJOR      1
35 #define VERSION_MINOR      3
36 #define VERSION_PATCH      0
37
38 /*
39  * Freeglut is meant to be available under all Unix/X11 and Win32 platforms.
40  */
41 #if !defined(_WIN32)
42 #   define  TARGET_HOST_UNIX_X11    1
43 #   define  TARGET_HOST_WIN32       0
44 #else
45 #   define  TARGET_HOST_UNIX_X11    0
46 #   define  TARGET_HOST_WIN32       1
47 #endif
48
49 #define  FREEGLUT_MAX_MENUS         3
50 #define  FREEGLUT_DEBUG             1
51
52 #if FREEGLUT_DEBUG
53     #undef   G_DISABLE_ASSERT
54     #undef   G_DISABLE_CHECKS
55 #else
56     #define  G_DISABLE_ASSERT
57     #define  G_DISABLE_CHECKS
58 #endif
59
60 /*
61  * Somehow all Win32 include headers depend on this one:
62  */
63 #if TARGET_HOST_WIN32
64 #include <windows.h>
65 #include <windowsx.h>
66
67 #define strdup   _strdup
68 #endif
69
70 /*
71  * Those files should be available on every platform.
72  */
73 #include <GL/gl.h>
74 #include <GL/glu.h>
75 #include <stdio.h>
76 #include <string.h>
77 #include <math.h>
78 #include <stdlib.h>
79 #include <assert.h>
80 #include <stdarg.h>
81 #if TARGET_HOST_UNIX_X11
82 #include <sys/time.h>
83 #endif
84
85 /*
86  * The system-dependant include files should go here:
87  */
88 #if TARGET_HOST_UNIX_X11
89     #include <GL/glx.h>
90     #include <X11/Xlib.h>
91     #include <X11/Xatom.h>
92     #include <X11/keysym.h>
93
94     #ifndef __sgi
95     #include <X11/extensions/xf86vmode.h>
96     #endif
97 #endif
98
99 /*
100  * Microsoft VisualC++ 5.0's <math.h> does not define the PI
101  */
102 #ifndef M_PI
103 #    define  M_PI  3.14159265358979323846
104 #endif
105
106 #ifndef TRUE
107 #    define  TRUE  1
108 #endif
109
110 #ifndef FALSE
111 #    define  FALSE  0
112 #endif
113
114 /* -- GLOBAL TYPE DEFINITIONS ---------------------------------------------- */
115
116 /*
117  * Freeglut callbacks type definitions
118  */
119 typedef void (* FGCBdisplay       )( void );
120 typedef void (* FGCBreshape       )( int, int );
121 typedef void (* FGCBvisibility    )( int );
122 typedef void (* FGCBkeyboard      )( unsigned char, int, int );
123 typedef void (* FGCBspecial       )( int, int, int );
124 typedef void (* FGCBmouse         )( int, int, int, int );
125 typedef void (* FGCBmotion        )( int, int );
126 typedef void (* FGCBpassive       )( int, int );
127 typedef void (* FGCBentry         )( int );
128 typedef void (* FGCBwindowStatus  )( int );
129 typedef void (* FGCBmenuState     )( int );
130 typedef void (* FGCBmenuStatus    )( int, int, int );
131 typedef void (* FGCBselect        )( int, int, int );
132 typedef void (* FGCBjoystick      )( unsigned int, int, int, int );
133 typedef void (* FGCBkeyboardUp    )( unsigned char, int, int );
134 typedef void (* FGCBspecialUp     )( int, int, int );
135 typedef void (* FGCBoverlayDisplay)( void );
136 typedef void (* FGCBspaceMotion   )( int, int, int );
137 typedef void (* FGCBspaceRotate   )( int, int, int );
138 typedef void (* FGCBspaceButton   )( int, int );
139 typedef void (* FGCBdials         )( int, int );
140 typedef void (* FGCBbuttonBox     )( int, int );
141 typedef void (* FGCBtabletMotion  )( int, int );
142 typedef void (* FGCBtabletButton  )( int, int, int, int );
143 typedef void (* FGCBdestroy       )( void );
144
145 /*
146  * The global callbacks type definitions
147  */
148 typedef void (* FGCBidle          )( void );
149 typedef void (* FGCBtimer         )( int );
150
151 /*
152  * The callback used when creating/using menus
153  */
154 typedef void (* FGCBmenu          )( int );
155
156
157 /*
158  * A list structure
159  */
160 typedef struct tagSFG_List SFG_List;
161 struct tagSFG_List
162 {
163     void *First;
164     void *Last;
165 };
166
167 /*
168  * A list node structure
169  */
170 typedef struct tagSFG_Node SFG_Node;
171 struct tagSFG_Node
172 {
173     void *Next;
174     void *Prev;
175 };
176
177 /*
178  * A helper structure holding two ints and a boolean
179  */
180 typedef struct tagSFG_XYUse SFG_XYUse;
181 struct tagSFG_XYUse
182 {
183     GLint           X, Y;               /* The two integers...               */
184     GLboolean       Use;                /* ...and a single boolean.          */
185 };
186
187 /*
188  * A helper structure holding a timeval and a boolean
189  */
190 typedef struct tagSFG_Time SFG_Time;
191 struct tagSFG_Time
192 {
193 #ifdef WIN32
194     DWORD Value;
195 #else
196     struct timeval  Value;
197 #endif
198     GLboolean       Set;
199 };
200
201 /*
202  * An enumeration containing the state of the GLUT execution:  initializing, running, or stopping
203  */
204 typedef enum {
205   GLUT_EXEC_STATE_INIT,
206   GLUT_EXEC_STATE_RUNNING,
207   GLUT_EXEC_STATE_STOP
208 } fgExecutionState ;
209
210 /*
211  * This structure holds different freeglut settings
212  */
213 typedef struct tagSFG_State SFG_State;
214 struct tagSFG_State
215 {
216     SFG_XYUse        Position;             /* The default windows' position     */
217     SFG_XYUse        Size;                 /* The default windows' size         */
218     unsigned int     DisplayMode;          /* The display mode for new windows  */
219
220     GLboolean        ForceDirectContext;   /* Should we force direct contexts?  */
221     GLboolean        TryDirectContext;     /* What about giving a try to?       */
222
223     GLboolean        ForceIconic;          /* All new top windows are iconified */
224
225     GLboolean        GLDebugSwitch;        /* OpenGL state debugging switch     */
226     GLboolean        XSyncSwitch;          /* X11 sync protocol switch          */
227
228     GLboolean        IgnoreKeyRepeat;      /* Whether to ignore key repeat...   */
229
230     GLuint           FPSInterval;          /* Interval between FPS printfs      */
231     GLuint           SwapCount;            /* Count of glutSwapBuffer calls     */
232     GLuint           SwapTime;             /* Time of last SwapBuffers          */
233
234     SFG_Time         Time;                 /* The time that glutInit was called */
235     SFG_List         Timers;               /* The freeglut timer hooks          */
236
237     FGCBidle         IdleCallback;         /* The global idle callback          */
238
239     FGCBmenuState    MenuStateCallback;    /* Menu callbacks are global         */
240     FGCBmenuStatus   MenuStatusCallback;
241
242     SFG_XYUse        GameModeSize;         /* The game mode screen's dimensions */
243     int              GameModeDepth;        /* The pixel depth for game mode     */
244     int              GameModeRefresh;      /* The refresh rate for game mode    */
245
246     int              ActionOnWindowClose ; /* Action when user clicks "x" on window header bar */
247
248     fgExecutionState ExecState ;           /* Current state of the GLUT execution */
249 };
250
251 /*
252  * The structure used by display initialization in freeglut_init.c
253  */
254 typedef struct tagSFG_Display SFG_Display;
255 struct tagSFG_Display
256 {
257 #if TARGET_HOST_UNIX_X11
258     Display*        Display;            /* The display we are being run in.  */
259     int             Screen;             /* The screen we are about to use.   */
260     Window          RootWindow;         /* The screen's root window.         */
261     int             Connection;         /* The display's connection number   */
262     Atom            DeleteWindow;       /* The window deletion atom          */
263
264 #ifdef X_XF86VidModeGetModeLine
265     XF86VidModeModeLine DisplayMode;    /* Current screen's display settings */
266     int             DisplayModeClock;   /* The display mode's refresh rate   */
267 #endif
268
269 #elif TARGET_HOST_WIN32
270     HINSTANCE        Instance;          /* The application's instance        */
271     DEVMODE         DisplayMode;        /* Desktop's display settings        */
272
273 #endif
274
275     int             ScreenWidth;        /* The screen's width in pixels      */
276     int             ScreenHeight;       /* The screen's height in pixels     */
277     int             ScreenWidthMM;      /* The screen's width in milimeters  */
278     int             ScreenHeightMM;     /* The screen's height in milimeters */
279 };
280
281
282 /*
283  * The user can create any number of timer hooks
284  */
285 typedef struct tagSFG_Timer SFG_Timer;
286 struct tagSFG_Timer
287 {
288     SFG_Node        Node;
289     int             ID;                 /* The timer ID integer              */
290     FGCBtimer       Callback;           /* The timer callback                */
291     long            TriggerTime;        /* The timer trigger time            */
292 };
293
294 /*
295  * A window and its OpenGL context. The contents of this structure
296  * are highly dependant on the target operating system we aim at...
297  */
298 typedef struct tagSFG_Context SFG_Context;
299 struct tagSFG_Context
300 {
301 #if TARGET_HOST_UNIX_X11
302     Window          Handle;             /* The window's handle                 */
303     GLXContext      Context;            /* The OpenGL context                  */
304     XVisualInfo*    VisualInfo;         /* The window's visual information     */
305
306 #elif TARGET_HOST_WIN32
307     HWND            Handle;             /* The window's handle                 */
308     HDC             Device;             /* The window's device context         */
309     HGLRC           Context;            /* The window's WGL context            */
310
311 #endif
312
313     int             DoubleBuffered;     /* Treat the window as double-buffered */
314 };
315
316 /*
317  * Window's state description. This structure should be kept portable.
318  */
319 typedef struct tagSFG_WindowState SFG_WindowState;
320 struct tagSFG_WindowState
321 {
322     int             Width;              /* Window's width in pixels          */
323     int             Height;             /* The same about the height         */
324
325     GLboolean       Redisplay;          /* Do we have to redisplay?          */
326     GLboolean       Visible;            /* Is the window visible now         */
327
328     int             Cursor;             /* The currently selected cursor     */
329     int             Modifiers;          /* The current ALT/SHIFT/CTRL state  */
330
331     long            JoystickPollRate;   /* The joystick polling rate         */
332     long            JoystickLastPoll;   /* When the last poll has happened   */
333
334     int             MouseX, MouseY;     /* The most recent mouse position    */
335
336     GLboolean       IsGameMode;         /* Is this the game mode window?     */
337
338 #if TARGET_HOST_WIN32
339     GLboolean       NeedToResize;       /* Do we need to explicitly resize?  */
340 #endif
341 };
342
343 /*
344  * The window callbacks the user can supply us with. Should be kept portable.
345  */
346 typedef struct tagSFG_WindowCallbacks SFG_WindowCallbacks;
347 struct tagSFG_WindowCallbacks
348 {
349     /*
350      * Following callbacks are fully supported right now
351      * and are ready to be tested for GLUT conformance:
352      */
353     FGCBdisplay         Display;
354     FGCBreshape         Reshape;
355     FGCBkeyboard        Keyboard;
356     FGCBkeyboardUp      KeyboardUp;
357     FGCBspecial         Special;
358     FGCBspecialUp       SpecialUp;
359     FGCBmouse           Mouse;
360     FGCBmotion          Motion;
361     FGCBpassive         Passive;
362     FGCBentry           Entry;
363     FGCBvisibility      Visibility;
364     FGCBwindowStatus    WindowStatus;
365     FGCBjoystick        Joystick;
366     FGCBdestroy         Destroy;
367
368     /*
369      * Those callbacks are being ignored for the moment
370      */
371     FGCBselect          Select;
372     FGCBoverlayDisplay  OverlayDisplay;
373     FGCBspaceMotion     SpaceMotion;
374     FGCBspaceRotate     SpaceRotation;
375     FGCBspaceButton     SpaceButton;
376     FGCBdials           Dials;
377     FGCBbuttonBox       ButtonBox;
378     FGCBtabletMotion    TabletMotion;
379     FGCBtabletButton    TabletButton;
380 };
381
382 /*
383  * This structure describes a menu
384  */
385 typedef struct tagSFG_Menu SFG_Menu;
386 struct tagSFG_Menu
387 {
388     SFG_Node            Node;
389     int                 ID;                     /* The global menu ID        */
390     SFG_List            Entries;                /* The menu entries list     */
391     FGCBmenu            Callback;               /* The menu callback         */
392     GLboolean           IsActive;               /* Is the menu selected?     */
393     int                 Width;                  /* Menu box width in pixels  */
394     int                 Height;                 /* Menu box height in pixels */
395     int                 X, Y;                   /* Menu box raster position  */
396 };
397
398 /*
399  * This is a menu entry
400  */
401 typedef struct tagSFG_MenuEntry SFG_MenuEntry;
402 struct tagSFG_MenuEntry
403 {
404     SFG_Node            Node;
405     int                 ID;                     /* The menu entry ID (local) */
406     int                 Ordinal;                /* The menu's ordinal number */
407     char*               Text;                   /* The text to be displayed  */
408     SFG_Menu*           SubMenu;                /* Optional sub-menu tree    */
409     GLboolean           IsActive;               /* Is the entry highlighted? */
410     int                 Width;                  /* Label's width in pixels   */
411 };
412
413 /*
414  * A window, making part of FreeGLUT windows hierarchy. Should be kept portable.
415  */
416 typedef struct tagSFG_Window SFG_Window;
417 struct tagSFG_Window
418 {
419     SFG_Node            Node;
420     int                 ID;                     /* Window's ID number        */
421
422     SFG_Context         Window;                 /* Window and OpenGL context */
423     SFG_WindowState     State;                  /* The window state          */
424     SFG_WindowCallbacks Callbacks;              /* The window callbacks      */
425
426     SFG_Menu*       Menu[ FREEGLUT_MAX_MENUS ]; /* Menus appended to window  */
427     SFG_Menu*       ActiveMenu;                 /* The window's active menu  */
428
429     SFG_Window*         Parent;                 /* The parent to this window */
430     SFG_List            Children;               /* The subwindows d.l. list  */
431 };
432
433 /*
434  * A linked list structure of windows
435  */
436 typedef struct tagSFG_WindowList SFG_WindowList ;
437 struct tagSFG_WindowList
438 {
439   SFG_Window *window ;
440   GLboolean needToClose ;
441   SFG_WindowList *next ;
442 } ;
443
444 /*
445  * This holds information about all the windows, menus etc.
446  */
447 typedef struct tagSFG_Structure SFG_Structure;
448 struct tagSFG_Structure
449 {
450     SFG_List            Windows;                /* The global windows list   */
451     SFG_List            Menus;                  /* The global menus list     */
452
453     SFG_Window*         Window;                 /* The currently active win. */
454     SFG_Menu*           Menu;                   /* Same, but menu...         */
455
456     SFG_Window*         GameMode;               /* The game mode window      */
457
458     int                 WindowID;               /* The new current window ID */
459     int                 MenuID;                 /* The new current menu ID   */
460 };
461
462 /*
463  * This structure is used for the enumeration purposes.
464  * You can easily extend its functionalities by declaring
465  * a structure containing enumerator's contents and custom
466  * data, then casting its pointer to (SFG_Enumerator *).
467  */
468 typedef struct tagSFG_Enumerator SFG_Enumerator;
469 struct tagSFG_Enumerator
470 {
471     GLboolean   found;                          /* Used to terminate search  */
472     void*       data;                           /* Custom data pointer       */
473 };
474 typedef void (* FGCBenumerator  )( SFG_Window *, SFG_Enumerator * );
475
476 /*
477  * The bitmap font structure
478  */
479 typedef struct tagSFG_Font SFG_Font;
480 struct tagSFG_Font
481 {
482     char*           Name;                       /* The source font name      */
483     int             Quantity;                   /* Number of chars in font   */
484     int             Height;                     /* Height of the characters  */
485     const GLubyte** Characters;                 /* The characters mapping    */
486
487     float           xorig, yorig ;              /* The origin of the character relative to the draw location */
488 };
489
490 /*
491  * The stroke font structures
492  */
493
494 typedef struct tagSFG_StrokeVertex SFG_StrokeVertex;
495 struct tagSFG_StrokeVertex
496 {
497     GLfloat         X, Y;
498 };
499
500 typedef struct tagSFG_StrokeStrip SFG_StrokeStrip;
501 struct tagSFG_StrokeStrip
502 {
503     int             Number;
504     const SFG_StrokeVertex* Vertices;
505 };
506
507 typedef struct tagSFG_StrokeChar SFG_StrokeChar;
508 struct tagSFG_StrokeChar
509 {
510     GLfloat         Right;
511     int             Number;
512     const SFG_StrokeStrip* Strips;
513 };
514
515 typedef struct tagSFG_StrokeFont SFG_StrokeFont;
516 struct tagSFG_StrokeFont
517 {
518     char*           Name;                       /* The source font name      */
519     int             Quantity;                   /* Number of chars in font   */
520     GLfloat         Height;                     /* Height of the characters  */
521     const SFG_StrokeChar** Characters;          /* The characters mapping    */
522 };
523
524 /* -- GLOBAL VARIABLES EXPORTS --------------------------------------------- */
525
526 /*
527  * Freeglut display related stuff (initialized once per session)
528  */
529 extern SFG_Display fgDisplay;
530
531 /*
532  * Freeglut internal structure
533  */
534 extern SFG_Structure fgStructure;
535
536 /*
537  * The current freeglut settings
538  */
539 extern SFG_State fgState;
540
541
542 /* -- PRIVATE FUNCTION DECLARATIONS ---------------------------------------- */
543
544 /*
545  * A call to this function makes us sure that the Display and Structure
546  * subsystems have been properly initialized and are ready to be used
547  */
548 #define  freeglut_assert_ready                      assert( fgState.Time.Set );
549
550 /*
551  * Following definitions are somewhat similiar to GLib's,
552  * but do not generate any log messages:
553  */
554 #define  freeglut_return_if_fail( expr )            if( !(expr) ) return;
555 #define  freeglut_return_val_if_fail( expr, val )   if( !(expr) ) return( val );
556
557 /*
558  * A call to those macros assures us that there is a current
559  * window and menu set, respectively:
560  */
561 #define  freeglut_assert_window                     assert( fgStructure.Window != NULL );
562 #define  freeglut_assert_menu                       assert( fgStructure.Menu != NULL );
563
564 /*
565  * The initialize and deinitialize functions get called on glutInit()
566  * and glutMainLoop() end respectively. They should create/clean up
567  * everything inside of the freeglut
568  */
569 void fgInitialize( const char* displayName );
570 void fgDeinitialize( void );
571
572 /*
573  * Those two functions are used to create/destroy the freeglut internal
574  * structures. This actually happens when calling glutInit() and when
575  * quitting the glutMainLoop() (which actually happens, when all windows
576  * have been closed).
577  */
578 void fgCreateStructure( void );
579 void fgDestroyStructure( void );
580
581 /*
582  * A helper function to check if a display mode is possible to use
583  */
584 #if TARGET_HOST_UNIX_X11
585 XVisualInfo* fgChooseVisual( void );
586 #endif
587
588 /*
589  * The window procedure for Win32 events handling
590  */
591 #if TARGET_HOST_WIN32
592 LRESULT CALLBACK fgWindowProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam );
593 GLboolean fgSetupPixelFormat( SFG_Window* window, GLboolean checkOnly, unsigned char layer_type );
594 #endif
595
596 /*
597  * Window creation, opening, closing and destruction.
598  * Defined in freeglut_structure.c, freeglut_window.c.
599  */
600 SFG_Window* fgCreateWindow( SFG_Window* parent, const char* title, int x, int y, int w, int h, GLboolean gameMode );
601 void        fgSetWindow ( SFG_Window *window ) ;
602 void        fgOpenWindow( SFG_Window* window, const char* title, int x, int y, int w, int h, GLboolean gameMode, int isSubWindow );
603 void        fgCloseWindow( SFG_Window* window );
604 void        fgAddToWindowDestroyList ( SFG_Window* window, GLboolean needToClose ) ;
605 void        fgCloseWindows () ;
606 void        fgDestroyWindow( SFG_Window* window, GLboolean needToClose );
607
608 /*
609  * Menu creation and destruction. Defined in freeglut_structure.c
610  */
611 SFG_Menu*   fgCreateMenu( FGCBmenu menuCallback );
612 void        fgDestroyMenu( SFG_Menu* menu );
613
614 /*
615  * Joystick device management functions, defined in freeglut_joystick.c
616  */
617 void        fgJoystickInit( int ident );
618 void        fgJoystickClose( void );
619 void        fgJoystickPollWindow( SFG_Window* window );
620
621 /*
622  * Helper function to enumerate through all registered windows
623  * and one to enumerate all of a window's subwindows...
624  *
625  * The GFunc callback for those functions will be defined as:
626  *
627  *      void enumCallback( gpointer window, gpointer enumerator );
628  *
629  * where window is the enumerated (sub)window pointer (SFG_Window *),
630  * and userData is the a custom user-supplied pointer. Functions
631  * are defined and exported from freeglut_structure.c file.
632  */
633 void fgEnumWindows( FGCBenumerator enumCallback, SFG_Enumerator* enumerator );
634 void fgEnumSubWindows( SFG_Window* window, FGCBenumerator enumCallback, SFG_Enumerator* enumerator );
635
636 /*
637  * fgWindowByHandle returns a (SFG_Window *) value pointing to the
638  * first window in the queue matching the specified window handle.
639  * The function is defined in freeglut_structure.c file.
640  */
641 #if TARGET_HOST_UNIX_X11
642     SFG_Window* fgWindowByHandle( Window hWindow );
643 #elif TARGET_HOST_WIN32
644
645     SFG_Window* fgWindowByHandle( HWND hWindow );
646 #endif
647
648 /*
649  * This function is similiar to the previous one, except it is
650  * looking for a specified (sub)window identifier. The function
651  * is defined in freeglut_structure.c file.
652  */
653 SFG_Window* fgWindowByID( int windowID );
654
655 /*
656  * Looks up a menu given its ID. This is easier that fgWindowByXXX
657  * as all menus are placed in a single doubly linked list...
658  */
659 SFG_Menu* fgMenuByID( int menuID );
660
661 /*
662  * The menu activation and deactivation the code. This is the meat
663  * of the menu user interface handling code...
664  */
665 void fgActivateMenu( SFG_Window* window, int button );
666 void fgExecuteMenuCallback( SFG_Menu* menu ) ;
667 GLboolean fgCheckActiveMenu ( SFG_Window *window, SFG_Menu *menu ) ;
668 void fgDeactivateMenu( SFG_Window *window );
669
670 /*
671  * This function gets called just before the buffers swap, so that
672  * freeglut can display the pull-down menus via OpenGL. The function
673  * is defined in freeglut_menu.c file.
674  */
675 void fgDisplayMenu( void );
676
677 /*
678  * Display the mouse cursor using OpenGL calls. The function
679  * is defined in freeglut_cursor.c file.
680  */
681 void fgDisplayCursor( void );
682
683 /*
684  * Elapsed time as per glutGet(GLUT_ELAPSED_TIME).
685  */
686 long fgElapsedTime( void );
687
688 /*
689  * List functions
690  */
691 void fgListInit(SFG_List *list);
692 void fgListAppend(SFG_List *list, SFG_Node *node);
693 void fgListRemove(SFG_List *list, SFG_Node *node);
694 int fgListLength(SFG_List *list);
695
696 /*
697  * Error Messages functions
698  */
699 void fgError( const char *fmt, ... );
700 void fgWarning( const char *fmt, ... );
701
702 #endif /* FREEGLUT_INTERNAL_H */
703
704 /*** END OF FILE ***/