vrseasons

annotate src/timer.c @ 2:eea1b91dc3d4

added is_complete() to framebuffer object and fixed GL_UNSUPPORTED_FRAMEBUFFER on intel
author John Tsiombikas <nuclear@member.fsf.org>
date Mon, 13 Apr 2015 16:51:52 +0300
parents
children
rev   line source
nuclear@0 1 #include "timer.h"
nuclear@0 2
nuclear@0 3 #if defined(__unix__) || defined(__APPLE__)
nuclear@0 4 #include <time.h>
nuclear@0 5
nuclear@0 6 unsigned long get_msec(void)
nuclear@0 7 {
nuclear@0 8 struct timespec ts;
nuclear@0 9 if(clock_gettime(CLOCK_MONOTONIC, &ts) == -1) {
nuclear@0 10 clock_gettime(CLOCK_REALTIME, &ts);
nuclear@0 11 }
nuclear@0 12 return ts.tv_sec * 1000ul + ts.tv_nsec / 1000000ul;
nuclear@0 13 }
nuclear@0 14
nuclear@0 15 #elif defined(WIN32)
nuclear@0 16 #include <windows.h>
nuclear@0 17
nuclear@0 18 unsigned long get_msec(void)
nuclear@0 19 {
nuclear@0 20 return timeGetTime();
nuclear@0 21 }
nuclear@0 22
nuclear@0 23 #endif