projects
/
freeglut
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
moved common files back to src root
[freeglut]
/
src
/
x11
/
freeglut_main_x11.c
diff --git
a/src/x11/freeglut_main_x11.c
b/src/x11/freeglut_main_x11.c
index
33553e3
..
e72db37
100644
(file)
--- a/
src/x11/freeglut_main_x11.c
+++ b/
src/x11/freeglut_main_x11.c
@@
-27,7
+27,7
@@
*/
#include <GL/freeglut.h>
*/
#include <GL/freeglut.h>
-#include "../Common/freeglut_internal.h"
+#include "../fg_internal.h"
#ifdef HAVE_ERRNO_H
# include <errno.h>
#endif
#ifdef HAVE_ERRNO_H
# include <errno.h>
#endif
@@
-89,9
+89,13
@@
void fgPlatformDisplayWindow ( SFG_Window *window )
}
}
-unsigned long fgPlatformSystemTime ( void )
+fg_time_t fgPlatformSystemTime ( void )
{
{
-#ifdef HAVE_GETTIMEOFDAY
+#ifdef CLOCK_MONOTONIC
+ struct timespec now;
+ clock_gettime(CLOCK_MONOTONIC, &now);
+ return now.tv_nsec/1000000 + now.tv_sec*1000;
+#elif defined(HAVE_GETTIMEOFDAY)
struct timeval now;
gettimeofday( &now, NULL );
return now.tv_usec/1000 + now.tv_sec*1000;
struct timeval now;
gettimeofday( &now, NULL );
return now.tv_usec/1000 + now.tv_sec*1000;
@@
-103,7
+107,7
@@
unsigned long fgPlatformSystemTime ( void )
* happens.
*/
* happens.
*/
-void fgPlatformSleepForEvents( long msec )
+void fgPlatformSleepForEvents( fg_time_t msec )
{
/*
* Possibly due to aggressive use of XFlush() and friends,
{
/*
* Possibly due to aggressive use of XFlush() and friends,