X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=src%2FCommon%2Ffreeglut_internal.h;h=9a3ef7b8712482d5898d560a60d74d8073ea38aa;hb=1ede9f68f98e29ddd07bd466310967e716bfac92;hp=bbd7f62ff489d853bf873b02910176c066941a4e;hpb=76169d74298feb3c4976af3f0f10376f56aec38d;p=freeglut diff --git a/src/Common/freeglut_internal.h b/src/Common/freeglut_internal.h index bbd7f62..9a3ef7b 100644 --- a/src/Common/freeglut_internal.h +++ b/src/Common/freeglut_internal.h @@ -47,6 +47,9 @@ || ( defined(__CYGWIN__) && defined(X_DISPLAY_MISSING) ) # define TARGET_HOST_MS_WINDOWS 1 +#elif defined (ANDROID) +# define TARGET_HOST_ANDROID 1 + #elif defined(__posix__) || defined(__unix__) || defined(__linux__) || defined(__sun) # define TARGET_HOST_POSIX_X11 1 @@ -151,9 +154,21 @@ #endif /* General defines */ - #define INVALID_MODIFIERS 0xffffffff +/* FreeGLUT internal time type */ +#if defined(HAVE_STDINT_H) +# include + typedef uint64_t fg_time_t; +#elif defined(HAVE_INTTYPES_H) +# include + typedef uint64_t fg_time_t; +#elif defined(HAVE_ULONG_LONG) + typedef unsigned long long fg_time_t; +#else + typedef unsigned long fg_time_t; +#endif + /* Platform-specific includes */ @@ -163,6 +178,9 @@ #if TARGET_HOST_MS_WINDOWS #include "../mswin/freeglut_internal_mswin.h" #endif +#if TARGET_HOST_ANDROID +#include "../android/freeglut_internal_android.h" +#endif /* -- GLOBAL TYPE DEFINITIONS ---------------------------------------------- */ @@ -272,7 +290,7 @@ struct tagSFG_State GLuint SwapCount; /* Count of glutSwapBuffer calls */ GLuint SwapTime; /* Time of last SwapBuffers */ - unsigned long Time; /* Time that glutInit was called */ + fg_time_t Time; /* Time that glutInit was called */ SFG_List Timers; /* The freeglut timer hooks */ SFG_List FreeTimers; /* The unused timer hooks */ @@ -327,7 +345,7 @@ struct tagSFG_Timer SFG_Node Node; int ID; /* The timer ID integer */ FGCBTimer Callback; /* The timer callback */ - long TriggerTime; /* The timer trigger time */ + fg_time_t TriggerTime; /* The timer trigger time */ }; /* @@ -361,7 +379,7 @@ struct tagSFG_WindowState int Cursor; /* The currently selected cursor */ long JoystickPollRate; /* The joystick polling rate */ - long JoystickLastPoll; /* When the last poll happened */ + fg_time_t JoystickLastPoll; /* When the last poll happened */ int MouseX, MouseY; /* The most recent mouse position */ @@ -919,10 +937,10 @@ void fgDeactivateMenu( SFG_Window *window ); void fgDisplayMenu( void ); /* Elapsed time as per glutGet(GLUT_ELAPSED_TIME). */ -long fgElapsedTime( void ); +fg_time_t fgElapsedTime( void ); /* System time in milliseconds */ -long unsigned fgSystemTime(void); +fg_time_t fgSystemTime(void); /* List functions */ void fgListInit(SFG_List *list); @@ -937,16 +955,15 @@ void fgWarning( const char *fmt, ... ); SFG_Proc fgPlatformGetProcAddress( const char *procName ); -/* Window functions needed for Platform implementations */ /* pushing attribute/value pairs into an array */ #define ATTRIB(a) attributes[where++]=(a) #define ATTRIB_VAL(a,v) {ATTRIB(a); ATTRIB(v);} -extern int fghIsLegacyContextVersionRequested( void ); -extern int fghMapBit( int mask, int from, int to ); -extern int fghIsLegacyContextRequested( void ); -extern void fghContextCreationError( void ); -extern int fghNumberOfAuxBuffersRequested( void ); +int fghIsLegacyContextVersionRequested( void ); +int fghMapBit( int mask, int from, int to ); +int fghIsLegacyContextRequested( void ); +void fghContextCreationError( void ); +int fghNumberOfAuxBuffersRequested( void ); #endif /* FREEGLUT_INTERNAL_H */