X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=src%2Ffreeglut_internal.h;h=eb8def5444c9ace91e28ce3ceb0ad2f3176a3578;hb=78330d209960186385d8878cba261fd0b1624d9d;hp=5b9df43bd12ef321f644a8d59e245a0c632ce2ca;hpb=646676b8dbf8ab504ac8a275fe9a63a403a3190b;p=freeglut diff --git a/src/freeglut_internal.h b/src/freeglut_internal.h index 5b9df43..eb8def5 100644 --- a/src/freeglut_internal.h +++ b/src/freeglut_internal.h @@ -29,8 +29,8 @@ #define FREEGLUT_INTERNAL_H /* XXX Update these for each release! */ -#define VERSION_MAJOR 1 -#define VERSION_MINOR 4 +#define VERSION_MAJOR 2 +#define VERSION_MINOR 0 #define VERSION_PATCH 0 /* @@ -89,7 +89,7 @@ #include #include - #ifndef __sgi + #ifdef HAVE_X11_EXTENSIONS_XF86VMODE_H #include #endif #endif @@ -219,6 +219,7 @@ struct tagSFG_State GLboolean TryDirectContext; /* What about giving a try to? */ GLboolean ForceIconic; /* All new top windows are iconified */ + GLboolean UseCurrentContext; /* New windows use current window's rendering context */ GLboolean GLDebugSwitch; /* OpenGL state debugging switch */ GLboolean XSyncSwitch; /* X11 sync protocol switch */ @@ -234,6 +235,8 @@ struct tagSFG_State FGCBidle IdleCallback; /* The global idle callback */ + GLboolean BuildingAMenu; /* True if we are presently making a menu */ + int ActiveMenus; /* Number of currently active menus */ FGCBmenuState MenuStateCallback; /* Menu callbacks are global */ FGCBmenuStatus MenuStatusCallback; @@ -241,9 +244,9 @@ struct tagSFG_State int GameModeDepth; /* The pixel depth for game mode */ int GameModeRefresh; /* The refresh rate for game mode */ - int ActionOnWindowClose ; /* Action when user clicks "x" on window header bar */ - - fgExecutionState ExecState ; /* Current state of the GLUT execution */ + int ActionOnWindowClose; /* Action when user clicks "x" on window header bar */ + fgExecutionState ExecState; /* Current state of the GLUT execution */ + char *ProgramName; }; /* @@ -260,8 +263,18 @@ struct tagSFG_Display Atom DeleteWindow; /* The window deletion atom */ #ifdef X_XF86VidModeGetModeLine + /* + * XF86VidMode may be compilable even if it fails at runtime. Therefore, + * the validity of the VidMode has to be tracked + */ + int DisplayModeValid; /* Flag that indicates runtime status*/ XF86VidModeModeLine DisplayMode; /* Current screen's display settings */ int DisplayModeClock; /* The display mode's refresh rate */ + int DisplayViewPortX; /* saved X location of the viewport */ + int DisplayViewPortY; /* saved Y location of the viewport */ + int DisplayPointerX; /* saved X location of the pointer */ + int DisplayPointerY; /* saved Y location of the pointer */ + #endif #elif TARGET_HOST_WIN32 @@ -378,8 +391,25 @@ struct tagSFG_WindowCallbacks }; /* + * This structure holds the OpenGL rendering context for all the menu windows + */ +typedef struct tagSFG_MenuContext SFG_MenuContext; +struct tagSFG_MenuContext +{ +#if TARGET_HOST_UNIX_X11 + GLXContext Context; /* The menu OpenGL context */ + XVisualInfo* VisualInfo; /* The window's visual information */ +#elif TARGET_HOST_WIN32 + HGLRC Context; /* The menu window's WGL context */ +#endif + +}; + +/* * This structure describes a menu */ +typedef struct tagSFG_Window SFG_Window; +typedef struct tagSFG_MenuEntry SFG_MenuEntry; typedef struct tagSFG_Menu SFG_Menu; struct tagSFG_Menu { @@ -393,12 +423,15 @@ struct tagSFG_Menu int Width; /* Menu box width in pixels */ int Height; /* Menu box height in pixels */ int X, Y; /* Menu box raster position */ + + SFG_MenuEntry *ActiveEntry ; /* Currently active entry in the menu */ + SFG_Window *Window ; /* OpenGL window for menu */ + SFG_Window *ParentWindow ; /* OpenGL window in which the menu is defined */ }; /* * This is a menu entry */ -typedef struct tagSFG_MenuEntry SFG_MenuEntry; struct tagSFG_MenuEntry { SFG_Node Node; @@ -413,7 +446,6 @@ struct tagSFG_MenuEntry /* * A window, making part of freeglut windows hierarchy. Should be kept portable. */ -typedef struct tagSFG_Window SFG_Window; struct tagSFG_Window { SFG_Node Node; @@ -429,6 +461,8 @@ struct tagSFG_Window SFG_Window* Parent; /* The parent to this window */ SFG_List Children; /* The subwindows d.l. list */ + + GLboolean IsMenu; /* Set to 1 if we are a menu */ }; /* @@ -454,6 +488,8 @@ struct tagSFG_Structure SFG_Window* Window; /* The currently active win. */ SFG_Menu* Menu; /* Same, but menu... */ + SFG_MenuContext* MenuContext; /* OpenGL rendering context for menus */ + SFG_Window* GameMode; /* The game mode window */ int WindowID; /* The new current window ID */ @@ -667,6 +703,7 @@ void fgActivateMenu( SFG_Window* window, int button ); void fgExecuteMenuCallback( SFG_Menu* menu ) ; GLboolean fgCheckActiveMenu ( SFG_Window *window, SFG_Menu *menu ) ; void fgDeactivateMenu( SFG_Window *window ); +void fgDeactivateSubMenu( SFG_MenuEntry *menuEntry ); /* * This function gets called just before the buffers swap, so that