17 #define VERSION_MAJOR 2    18 #define VERSION_MINOR 4    19 #define VERSION_PATCH 0    22 #if defined(_WIN32_WCE)    23 #define TARGET_HOST_UNIX_X11 0    24 #define TARGET_HOST_WIN32 0    25 #define TARGET_HOST_WINCE 1    26 #elif defined(_MSC_VER) || defined(__CYGWIN__) || defined(__MINGW32__)    27 #define TARGET_HOST_UNIX_X11 0    28 #define TARGET_HOST_WIN32 1    29 #define TARGET_HOST_WINCE 0    31 #define TARGET_HOST_UNIX_X11 1    32 #define TARGET_HOST_WIN32 0    33 #define TARGET_HOST_WINCE 0    36 #define FREEGLUT_MAX_MENUS 3    48 #define strdup _strdup    59 #include <sys/types.h>    64 #if TIME_WITH_SYS_TIME    76 #if TARGET_HOST_UNIX_X11    78 #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   165 #if TARGET_HOST_WIN32 || TARGET_HOST_WINCE   236 #if TARGET_HOST_UNIX_X11   243 #ifdef X_XF86VidModeGetModeLine   248     int DisplayModeValid; 
   249     XF86VidModeModeLine DisplayMode; 
   250     int DisplayModeClock; 
   251     int DisplayViewPortX; 
   252     int DisplayViewPortY; 
   258 #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   365 #define SET_WCB(window, cbname, func)                               \   368         if (FETCH_WCB(window, cbname) != (SFG_Proc)(func))          \   369             (((window).CallBacks[CB_##cbname]) = (SFG_Proc)(func)); \   383 #define FETCH_WCB(window, cbname) ((window).CallBacks[CB_##cbname])   404 #if TARGET_HOST_WIN32   405 #define INVOKE_WCB(window, cbname, arg_list)                               \   408         if (FETCH_WCB(window, cbname))                                     \   410             FGCB##cbname func = (FGCB##cbname)(FETCH_WCB(window, cbname)); \   411             fgSetWindow(&window);                                          \   416 #define INVOKE_WCB(window, cbname, arg_list)                    \   419         if (FETCH_WCB(window, cbname))                          \   421             fgSetWindow(&window);                               \   422             ((FGCB##cbname)FETCH_WCB(window, cbname)) arg_list; \   480 #if TARGET_HOST_UNIX_X11   648 #define FREEGLUT_EXIT_IF_NOT_INITIALISED(string)  \   649     if (!fgState.Initialised)                     \   652             " ERROR:  Function <%s> called"       \   653             " without first calling 'glutInit'.", \   657 #define FREEGLUT_INTERNAL_ERROR_EXIT_IF_NOT_INITIALISED(string) \   658     if (!fgState.Initialised)                                   \   661             " ERROR:  Internal <%s> function called"            \   662             " without first calling 'glutInit'.",               \   666 #define FREEGLUT_INTERNAL_ERROR_EXIT(cond, string, function)         \   670             " ERROR:  Internal error <%s> in function %s", (string), \   678 #define freeglut_return_if_fail(expr) \   680 #define freeglut_return_val_if_fail(expr, val) \   681     if (!(expr)) return val;   687 #define FREEGLUT_EXIT_IF_NO_WINDOW(string)      \   688     if (!fgStructure.CurrentWindow)             \   691             " ERROR:  Function <%s> called"     \   692             " with no current window defined.", \   713 #if TARGET_HOST_UNIX_X11   718 #if TARGET_HOST_WIN32 || TARGET_HOST_WINCE   720     fgWindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
   731     SFG_Window* parent, 
const char* title, 
int x, 
int y, 
int w, 
int h,
   735     SFG_Window* window, 
const char* title, 
int x, 
int y, 
int w, 
int h,
   825 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)
 
void(* FGCBMouse)(int, int, int, int)
 
int fgJoystickDetect(void)
 
fgExecutionState ExecState
 
GLboolean fgCheckActiveMenu(SFG_Window *window, int button, GLboolean pressed, int mouse_x, int mouse_y)
 
void(* FGCBButtonBox)(int, int)
 
void fgDestroyWindow(SFG_Window *window)
 
void fgListAppend(SFG_List *list, SFG_Node *node)
 
void(* FGCBOverlayDisplay)(void)
 
#define FREEGLUT_MAX_MENUS
 
GLboolean IgnoreKeyRepeat
 
void(* FGCBJoystick)(unsigned int, int, int, int)
 
void(* FGCBWindowStatus)(int)
 
void fgSetWindow(SFG_Window *window)
 
FGCBMenuState MenuStateCallback
 
void(* FGCBenumerator)(SFG_Window *, SFG_Enumerator *)
 
const SFG_StrokeVertex * Vertices
 
void(* FGCBMouseWheel)(int, int, int, int)
 
void(* FGCBMenuStatus)(int, int, int)
 
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(* FGCBSpaceMotion)(int, int, int)
 
FGCBMenuStatus MenuStatusCallback
 
GLboolean JoysticksInitialised
 
void(* FGCBSpaceRotation)(int, int, int)
 
GLubyte GLubyte GLubyte GLubyte w
 
SFG_List WindowsToDestroy
 
void(* FGCBPassive)(int, int)
 
SFG_WindowContextType Context
 
void(* FGCBVisibility)(int)
 
SFG_Menu * fgCreateMenu(FGCBMenu menuCallback)
 
void(* FGCBSpecial)(int, int, int)
 
void fgJoystickPollWindow(SFG_Window *window)
 
SFG_Menu * fgMenuByID(int menuID)
 
void(* FGCBDisplay)(void)
 
void fgDeactivateMenu(SFG_Window *window)
 
void fgError(const char *fmt,...)
 
void(* FGCBDials)(int, int)
 
void(* FGCBTabletButton)(int, int, int, int)
 
SFG_Window * fgWindowByHandle(SFG_WindowHandleType hWindow)
 
void fgDestroyMenu(SFG_Menu *menu)
 
void(* FGCBTabletMotion)(int, int)
 
void(* FGCBSpecialUp)(int, int, int)
 
void(* FGCBMotion)(int, int)
 
void(* FGCBKeyboard)(unsigned char, int, int)
 
void fgCreateStructure(void)
 
void(* FGCBSpaceButton)(int, int)
 
const GLubyte ** Characters
 
void fgListInit(SFG_List *list)
 
const SFG_StrokeStrip * Strips
 
SFG_Proc CallBacks[TOTAL_CALLBACKS]
 
int fgListLength(SFG_List *list)
 
SFG_Structure fgStructure
 
void fgInitialiseJoysticks(void)
 
SFG_WindowHandleType Handle
 
GLXContext SFG_WindowContextType
 
void fgJoystickClose(void)
 
SFG_Window * fgWindowByID(int windowID)
 
XVisualInfo * fgChooseVisual(void)
 
void(* FGCBSelect)(int, int, int)
 
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 fgDeinitialize(void)
 
void(* FGCBMenuState)(int)
 
void(* FGCBReshape)(int, int)
 
typedef void(APIENTRYP PFNGLBLENDCOLORPROC)(GLclampf red
 
const SFG_StrokeChar ** Characters
 
void fgCloseWindow(SFG_Window *window)
 
void(* FGCBDestroy)(void)
 
void fgListRemove(SFG_List *list, SFG_Node *node)
 
int glutJoystickNotWorking(int ident)
 
void(* FGCBKeyboardUp)(unsigned char, 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)