diff options
| author | navewindre <boneyaard@gmail.com> | 2025-09-03 20:10:09 +0200 |
|---|---|---|
| committer | navewindre <boneyaard@gmail.com> | 2025-09-03 20:10:09 +0200 |
| commit | f8b92ce3aa08b1445c9f956d8166830946562d12 (patch) | |
| tree | 94e63a5aec9f8f52b577f56799e0c9201fd976a5 /src/util.h | |
a
Diffstat (limited to 'src/util.h')
| -rw-r--r-- | src/util.h | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/util.h b/src/util.h new file mode 100644 index 0000000..32fdb7e --- /dev/null +++ b/src/util.h @@ -0,0 +1,31 @@ +#pragma once +#include <SDL.h> + +#include "SDL_timer.h" +#include "util/color.h" +#include "util/allocator.h" +#include "util/vector.h" +#include "util/math.h" +#include "util/config.h" +#include "util/screen.h" +#include "util/input.h" +#include "util/file.h" +#include "util/thread.h" + +inline U64 u_tick() { + return (F64)SDL_GetPerformanceCounter() * 10000 / ((F64)SDL_GetPerformanceFrequency() ); +} + +inline F32 u_time() { + return SDL_GetTicks64() / 1000.f; +} + +template < typename T > +T min( T a, T b ) { + return a < b? a : b; +} + +template < typename T > +T max( T a, T b ) { + return a > b? a : b; +} |
