src/timer/SDL_timer.c
changeset 7139 dd722e7460c5
parent 6977 b73d51026c68
child 7191 75360622e65f
--- a/src/timer/SDL_timer.c	Thu May 02 21:23:38 2013 -0400
+++ b/src/timer/SDL_timer.c	Thu May 02 21:40:59 2013 -0400
@@ -26,6 +26,8 @@
 #include "SDL_cpuinfo.h"
 #include "SDL_thread.h"
 
+extern void SDL_StartTicks(void);
+
 /* #define DEBUG_TIMERS */
 
 typedef struct _SDL_Timer
@@ -70,6 +72,16 @@
 
 static SDL_TimerData SDL_timer_data;
 
+static Uint32 ticks_started = 0;
+
+void
+SDL_InitTicks(void)
+{
+    if (!ticks_started) {
+        SDL_StartTicks();
+        ticks_started = 1;
+    }
+}
 
 /* The idea here is that any thread might add a timer, but a single
  * thread manages the active timer queue, sorted by scheduling time.