summaryrefslogtreecommitdiff
path: root/src/util.h
blob: 32fdb7ebda0a19d8520e94567a0e48909092f07f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
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;
}