10 #ifndef  FREEGLUT_INTERNAL_H    11 #define  FREEGLUT_INTERNAL_H    18 #define  VERSION_MAJOR 2    19 #define  VERSION_MINOR 4    20 #define  VERSION_PATCH 0    23 #if defined(_WIN32_WCE)    24 #   define  TARGET_HOST_UNIX_X11    0    25 #   define  TARGET_HOST_WIN32       0    26 #   define  TARGET_HOST_WINCE       1    27 #elif defined(_MSC_VER) || defined(__CYGWIN__) || defined(__MINGW32__)    28 #   define  TARGET_HOST_UNIX_X11    0    29 #   define  TARGET_HOST_WIN32       1    30 #   define  TARGET_HOST_WINCE       0    32 #   define  TARGET_HOST_UNIX_X11    1    33 #   define  TARGET_HOST_WIN32       0    34 #   define  TARGET_HOST_WINCE       0    37 #define  FREEGLUT_MAX_MENUS         3    48 #define strdup   _strdup    59 #    include <sys/types.h>    64 #if TIME_WITH_SYS_TIME    65 #    include <sys/time.h>    69 #        include <sys/time.h>    76 #if TARGET_HOST_UNIX_X11    79     #include <X11/Xatom.h>    80     #include <X11/keysym.h>    82     #ifdef HAVE_X11_EXTENSIONS_XF86VMODE_H    83     #include <X11/extensions/xf86vmode.h>    89 #    define  M_PI  3.14159265358979323846   166 #if TARGET_HOST_WIN32 || TARGET_HOST_WINCE   235 #if TARGET_HOST_UNIX_X11   242 #ifdef X_XF86VidModeGetModeLine   247     int             DisplayModeValid;   
   248     XF86VidModeModeLine DisplayMode;    
   249     int             DisplayModeClock;   
   250     int             DisplayViewPortX;   
   251     int             DisplayViewPortY;   
   257 #elif TARGET_HOST_WIN32 || TARGET_HOST_WINCE   284 #if TARGET_HOST_UNIX_X11   289 #elif TARGET_HOST_WIN32 || TARGET_HOST_WINCE   306 #if TARGET_HOST_UNIX_X11   308 #elif TARGET_HOST_WIN32 || TARGET_HOST_WINCE   367 #define SET_WCB(window,cbname,func)                            \   370     if( FETCH_WCB( window, cbname ) != (SFG_Proc)(func) )      \   371         (((window).CallBacks[CB_ ## cbname]) = (SFG_Proc)(func)); \   385 #define FETCH_WCB(window,cbname) \   386     ((window).CallBacks[CB_ ## cbname])   407 #if TARGET_HOST_WIN32   408 #define INVOKE_WCB(window,cbname,arg_list)    \   411     if( FETCH_WCB( window, cbname ) )         \   413         FGCB ## cbname func = (FGCB ## cbname)(FETCH_WCB( window, cbname )); \   414         fgSetWindow( &window );               \   419 #define INVOKE_WCB(window,cbname,arg_list)    \   422     if( FETCH_WCB( window, cbname ) )         \   424         fgSetWindow( &window );               \   425         ((FGCB ## cbname)FETCH_WCB( window, cbname )) arg_list; \   484 #if TARGET_HOST_UNIX_X11   654 #define  FREEGLUT_EXIT_IF_NOT_INITIALISED( string )               \   655   if ( ! fgState.Initialised )                                    \   657     fgError ( " ERROR:  Function <%s> called"                     \   658               " without first calling 'glutInit'.", (string) ) ;  \   661 #define  FREEGLUT_INTERNAL_ERROR_EXIT_IF_NOT_INITIALISED( string )  \   662   if ( ! fgState.Initialised )                                      \   664     fgError ( " ERROR:  Internal <%s> function called"              \   665               " without first calling 'glutInit'.", (string) ) ;    \   668 #define  FREEGLUT_INTERNAL_ERROR_EXIT( cond, string, function )  \   671     fgError ( " ERROR:  Internal error <%s> in function %s",     \   672               (string), (function) ) ;                           \   679 #define  freeglut_return_if_fail( expr ) \   682 #define  freeglut_return_val_if_fail( expr, val ) \   690 #define  FREEGLUT_EXIT_IF_NO_WINDOW( string )                   \   691   if ( ! fgStructure.CurrentWindow )                            \   693     fgError ( " ERROR:  Function <%s> called"                   \   694               " with no current window defined.", (string) ) ;  \   713 #if TARGET_HOST_UNIX_X11   718 #if TARGET_HOST_WIN32 || TARGET_HOST_WINCE   719 LRESULT 
CALLBACK fgWindowProc( HWND hWnd, UINT uMsg,
   720                                WPARAM wParam, LPARAM lParam );
   722                               unsigned char layer_type );
   731                             int x, 
int y, 
int w, 
int h,
   802                               int mouse_x, 
int mouse_y );
   823 void fgError( 
const char *fmt, ... );
 
void fgEnumSubWindows(SFG_Window *window, FGCBenumerator enumCallback, SFG_Enumerator *enumerator)
 
SFG_Window * fgCreateWindow(SFG_Window *parent, const char *title, int x, int y, int w, int h, GLboolean gameMode, GLboolean isMenu)
 
int fgJoystickDetect(void)
 
fgExecutionState ExecState
 
GLboolean fgCheckActiveMenu(SFG_Window *window, int button, GLboolean pressed, int mouse_x, int mouse_y)
 
void(* FGCBOverlayDisplay)(void)
 
void(* FGCBTabletMotion)(int, int)
 
void fgDestroyWindow(SFG_Window *window)
 
void fgListAppend(SFG_List *list, SFG_Node *node)
 
#define FREEGLUT_MAX_MENUS
 
GLboolean IgnoreKeyRepeat
 
void fgSetWindow(SFG_Window *window)
 
void(* FGCBDials)(int, int)
 
FGCBMenuState MenuStateCallback
 
const SFG_StrokeVertex * Vertices
 
struct __GLXcontextRec * GLXContext
 
int glutJoystickGetNumAxes(int ident)
 
Window SFG_WindowHandleType
 
void fgOpenWindow(SFG_Window *window, const char *title, int x, int y, int w, int h, GLboolean gameMode, GLboolean isSubWindow)
 
SFG_Menu * Menu[FREEGLUT_MAX_MENUS]
 
void(* FGCBMouseWheel)(int, int, int, int)
 
void(* FGCBMenuStatus)(int, int, int)
 
void(* FGCBJoystick)(unsigned int, int, int, int)
 
FGCBMenuStatus MenuStatusCallback
 
GLboolean JoysticksInitialised
 
GLubyte GLubyte GLubyte GLubyte w
 
SFG_List WindowsToDestroy
 
void(* FGCBDestroy)(void)
 
void(* FGCBTabletButton)(int, int, int, int)
 
SFG_WindowContextType Context
 
SFG_Menu * fgCreateMenu(FGCBMenu menuCallback)
 
void(* FGCBButtonBox)(int, int)
 
void fgJoystickPollWindow(SFG_Window *window)
 
SFG_Menu * fgMenuByID(int menuID)
 
void fgDeactivateMenu(SFG_Window *window)
 
void fgError(const char *fmt,...)
 
SFG_Window * fgWindowByHandle(SFG_WindowHandleType hWindow)
 
void fgDestroyMenu(SFG_Menu *menu)
 
void fgCreateStructure(void)
 
void(* FGCBVisibility)(int)
 
const GLubyte ** Characters
 
void fgListInit(SFG_List *list)
 
const SFG_StrokeStrip * Strips
 
void(* FGCBDisplay)(void)
 
void(* FGCBKeyboard)(unsigned char, int, int)
 
SFG_Proc CallBacks[TOTAL_CALLBACKS]
 
int fgListLength(SFG_List *list)
 
void(* FGCBenumerator)(SFG_Window *, SFG_Enumerator *)
 
void(* FGCBWindowStatus)(int)
 
void(* FGCBSpecial)(int, int, int)
 
SFG_Structure fgStructure
 
void(* FGCBMouse)(int, int, int, int)
 
void fgInitialiseJoysticks(void)
 
SFG_WindowHandleType Handle
 
GLXContext SFG_WindowContextType
 
void fgJoystickClose(void)
 
SFG_Window * fgWindowByID(int windowID)
 
XVisualInfo * fgChooseVisual(void)
 
void fgWarning(const char *fmt,...)
 
SFG_Window * CurrentWindow
 
GLboolean UseCurrentContext
 
SFG_MenuContext * MenuContext
 
void fgDestroyStructure(void)
 
void fgAddToWindowDestroyList(SFG_Window *window)
 
void fgSetCursor(SFG_Window *window, int cursorID)
 
void(* FGCBSelect)(int, int, int)
 
void fgDeinitialize(void)
 
typedef void(APIENTRYP PFNGLBLENDCOLORPROC)(GLclampf red
 
const SFG_StrokeChar ** Characters
 
void fgCloseWindow(SFG_Window *window)
 
void(* FGCBPassive)(int, int)
 
void(* FGCBKeyboardUp)(unsigned char, int, int)
 
void(* FGCBSpaceButton)(int, int)
 
void(* FGCBMenuState)(int)
 
void(* FGCBSpaceRotation)(int, int, int)
 
void(* FGCBSpaceMotion)(int, int, int)
 
void(* FGCBSpecialUp)(int, int, int)
 
void fgListRemove(SFG_List *list, SFG_Node *node)
 
int glutJoystickNotWorking(int ident)
 
void(* FGCBMotion)(int, int)
 
void(* FGCBReshape)(int, int)
 
void fgUpdateMenuHighlight(SFG_Menu *menu)
 
int glutJoystickGetNumButtons(int ident)
 
void fgEnumWindows(FGCBenumerator enumCallback, SFG_Enumerator *enumerator)
 
void fgListInsert(SFG_List *list, SFG_Node *next, SFG_Node *node)