Wrap tick API

This avoids to use the SDL timer API directly, and will allow to handle
generic ticks (possibly negative).
This commit is contained in:
Romain Vimont
2021-07-04 16:50:19 +02:00
parent 5524f378c8
commit ec871dd3f5
8 changed files with 58 additions and 16 deletions

View File

@@ -5,7 +5,8 @@
#include <stdatomic.h>
#include <stdbool.h>
#include <stdint.h>
#include "tick.h"
/* Forward declarations */
typedef struct SDL_Thread SDL_Thread;
@@ -72,7 +73,7 @@ sc_cond_wait(sc_cond *cond, sc_mutex *mutex);
// return true on signaled, false on timeout
bool
sc_cond_timedwait(sc_cond *cond, sc_mutex *mutex, uint32_t ms);
sc_cond_timedwait(sc_cond *cond, sc_mutex *mutex, sc_tick ms);
void
sc_cond_signal(sc_cond *cond);