X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=src%2Ffg_internal.h;h=61ae5ced9479606e2300f144ec6491a636c8cb74;hb=8169011b88194be1123eb34fcddfd51e85640e94;hp=6fa691f97693a31119cc3ad0c892c7ec866ed0fd;hpb=b3a03b79ce621fec579f930c63ba2fdf526d66db;p=freeglut diff --git a/src/fg_internal.h b/src/fg_internal.h index 6fa691f..61ae5ce 100644 --- a/src/fg_internal.h +++ b/src/fg_internal.h @@ -32,11 +32,6 @@ # include "config.h" #endif -/* XXX Update these for each release! */ -#define VERSION_MAJOR 3 -#define VERSION_MINOR 0 -#define VERSION_PATCH 0 - /* Freeglut is intended to function under all Unix/X11 and Win32 platforms. */ /* XXX: Don't all MS-Windows compilers (except Cygwin) have _WIN32 defined? * XXX: If so, remove the first set of defined()'s below. @@ -47,7 +42,7 @@ || ( defined(__CYGWIN__) && defined(X_DISPLAY_MISSING) ) # define TARGET_HOST_MS_WINDOWS 1 -#elif defined (ANDROID) +#elif defined (__ANDROID__) # define TARGET_HOST_ANDROID 1 #elif defined(__posix__) || defined(__unix__) || defined(__linux__) || defined(__sun) @@ -171,7 +166,13 @@ typedef unsigned long fg_time_t; #endif - +#ifndef __fg_unused +# ifdef __GNUC__ +# define __fg_unused __attribute__((unused)) +# else +# define __fg_unused +# endif +#endif /* Platform-specific includes */ #if TARGET_HOST_POSIX_X11 @@ -218,6 +219,10 @@ typedef void (* FGCBMultiButton )( int, int, int, int, int ); typedef void (* FGCBMultiMotion )( int, int, int ); typedef void (* FGCBMultiPassive )( int, int, int ); +typedef void (* FGCBInitContext)(); +typedef void (* FGCBPause)(); +typedef void (* FGCBResume)(); + /* The global callbacks type definitions */ typedef void (* FGCBIdle )( void ); typedef void (* FGCBTimer )( int ); @@ -319,10 +324,13 @@ struct tagSFG_State int AuxiliaryBufferNumber; /* Number of auxiliary buffers */ int SampleNumber; /* Number of samples per pixel */ + GLboolean SkipStaleMotion; /* skip stale motion events */ + int MajorVersion; /* Major OpenGL context version */ int MinorVersion; /* Minor OpenGL context version */ int ContextFlags; /* OpenGL context flags */ int ContextProfile; /* OpenGL context profile */ + int HasOpenGL20; /* fgInitGL2 could find all OpenGL 2.0 functions */ FGError ErrorFunc; /* User defined error handler */ FGWarning WarningFunc; /* User defined warning handler */ }; @@ -363,6 +371,8 @@ struct tagSFG_Context SFG_PlatformContext pContext; /* The window's FBConfig (X11) or device context (Windows) */ int DoubleBuffered; /* Treat the window as double-buffered */ + GLint attribute_v_coord; + GLint attribute_v_normal; }; @@ -391,6 +401,8 @@ struct tagSFG_WindowState GLboolean NeedToResize; /* Do we need to resize the window? */ GLboolean IsFullscreen; /* is the window fullscreen? */ + + GLboolean NeedToInitContext; /* are OpenGL context/resources loaded? */ }; @@ -522,6 +534,11 @@ enum CB_MultiMotion, CB_MultiPassive, + /* Mobile platforms LifeCycle */ + CB_InitContext, + CB_Pause, + CB_Resume, + /* Presently ignored */ CB_Select, CB_OverlayDisplay, @@ -644,7 +661,8 @@ struct tagSFG_Enumerator GLboolean found; /* Used to terminate search */ void* data; /* Custom data pointer */ }; -typedef void (* FGCBenumerator )( SFG_Window *, SFG_Enumerator * ); +typedef void (* FGCBWindowEnumerator )( SFG_Window *, SFG_Enumerator * ); +typedef void (* FGCBMenuEnumerator )( SFG_Menu *, SFG_Enumerator * ); /* The bitmap font structure */ typedef struct tagSFG_Font SFG_Font; @@ -898,8 +916,8 @@ void fgSetCursor ( SFG_Window *window, int cursorID ); * and userData is the a custom user-supplied pointer. Functions * are defined and exported from freeglut_structure.c file. */ -void fgEnumWindows( FGCBenumerator enumCallback, SFG_Enumerator* enumerator ); -void fgEnumSubWindows( SFG_Window* window, FGCBenumerator enumCallback, +void fgEnumWindows( FGCBWindowEnumerator enumCallback, SFG_Enumerator* enumerator ); +void fgEnumSubWindows( SFG_Window* window, FGCBWindowEnumerator enumCallback, SFG_Enumerator* enumerator ); /* @@ -923,6 +941,12 @@ SFG_Window* fgWindowByID( int windowID ); SFG_Menu* fgMenuByID( int menuID ); /* + * Returns active menu, if any. Assumption: only one menu active throughout application at any one time. + * This is easier than fgWindowByXXX as all menus are placed in one doubly linked list... + */ +SFG_Menu* fgGetActiveMenu( ); + +/* * The menu activation and deactivation the code. This is the meat * of the menu user interface handling code... */ @@ -961,7 +985,6 @@ SFG_Proc fgPlatformGetProcAddress( const char *procName ); #define ATTRIB(a) attributes[where++]=(a) #define ATTRIB_VAL(a,v) {ATTRIB(a); ATTRIB(v);} -int fghIsLegacyContextVersionRequested( void ); int fghMapBit( int mask, int from, int to ); int fghIsLegacyContextRequested( void ); void fghContextCreationError( void );