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 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 165 #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 283 #if TARGET_HOST_UNIX_X11 288 #elif TARGET_HOST_WIN32 || TARGET_HOST_WINCE 305 #if TARGET_HOST_UNIX_X11 307 #elif TARGET_HOST_WIN32 || TARGET_HOST_WINCE 364 #define SET_WCB(window, cbname, func) \ 367 if (FETCH_WCB(window, cbname) != (SFG_Proc)(func)) \ 368 (((window).CallBacks[CB_##cbname]) = (SFG_Proc)(func)); \ 382 #define FETCH_WCB(window, cbname) ((window).CallBacks[CB_##cbname]) 403 #if TARGET_HOST_WIN32 404 #define INVOKE_WCB(window, cbname, arg_list) \ 407 if (FETCH_WCB(window, cbname)) \ 409 FGCB##cbname func = (FGCB##cbname)(FETCH_WCB(window, cbname)); \ 410 fgSetWindow(&window); \ 415 #define INVOKE_WCB(window, cbname, arg_list) \ 418 if (FETCH_WCB(window, cbname)) \ 420 fgSetWindow(&window); \ 421 ((FGCB##cbname)FETCH_WCB(window, cbname)) arg_list; \ 479 #if TARGET_HOST_UNIX_X11 647 #define FREEGLUT_EXIT_IF_NOT_INITIALISED(string) \ 648 if (!fgState.Initialised) \ 651 " ERROR: Function <%s> called" \ 652 " without first calling 'glutInit'.", \ 656 #define FREEGLUT_INTERNAL_ERROR_EXIT_IF_NOT_INITIALISED(string) \ 657 if (!fgState.Initialised) \ 660 " ERROR: Internal <%s> function called" \ 661 " without first calling 'glutInit'.", \ 665 #define FREEGLUT_INTERNAL_ERROR_EXIT(cond, string, function) \ 669 " ERROR: Internal error <%s> in function %s", (string), \ 677 #define freeglut_return_if_fail(expr) \ 679 #define freeglut_return_val_if_fail(expr, val) \ 680 if (!(expr)) return val; 686 #define FREEGLUT_EXIT_IF_NO_WINDOW(string) \ 687 if (!fgStructure.CurrentWindow) \ 690 " ERROR: Function <%s> called" \ 691 " with no current window defined.", \ 712 #if TARGET_HOST_UNIX_X11 717 #if TARGET_HOST_WIN32 || TARGET_HOST_WINCE 719 fgWindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
730 SFG_Window* parent,
const char* title,
int x,
int y,
int w,
int h,
734 SFG_Window* window,
const char* title,
int x,
int y,
int w,
int h,
824 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)