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