-
Notifications
You must be signed in to change notification settings - Fork 0
/
platform.h
72 lines (59 loc) · 1.28 KB
/
platform.h
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#if !defined(PLATFORM_H)
#define PLATFORM_H
/*
#include <stdint.h>
#include "timer.h"
#include "globals.h"
*/
#define internal static
#define local_persist static
#define global_variable static
#define Kilobytes(Count) ((Count)*1024ll)
#define Megabytes(Count) (Kilobytes(Count)*1024ll)
#define Gigabytes(Count) (Megabytes(Count)*1024ll)
typedef int8_t int8;
typedef int16_t int16;
typedef int32_t int32;
typedef int64_t int64;
typedef uint8_t uint8;
typedef uint16_t uint16;
typedef uint32_t uint32;
typedef uint64_t uint64;
typedef int8 bool8;
typedef int32 bool32;
typedef float real32;
typedef double real64;
struct game_button_state{
bool8 EndedDown;
bool8 Changed;
};
struct game_input{
int32 MouseX;
int32 MouseY;
union{
game_button_state Buttons[5];
struct{
game_button_state p;
game_button_state Space;
game_button_state MouseLeft;
game_button_state MouseRight;
game_button_state Escape;
};
};
};
struct game_memory{
void *BaseAddress;
uint64 Size;
//bool32 IsGameStateInitialized;
};
struct platform_state{
SDL_Renderer* Renderer;
SDL_Window* Window;
SDL_Event Event;
Timer FPS;
SDL_Rect screen_outline{ 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT };
bool32 Running;
bool32 PlaybackStarted;
uint32 FrameCount;
};
#endif //PLATFORM_H