blob: 91c305417968b54d2ccfcaf7ea459bdae109e120 (
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
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
73
74
75
|
#ifndef GAME_MAIN_H
#define GAME_MAIN_H
#define KB(b) (((u64)1024)*(b))
#define MB(b) (((u64)1024)*(KB(b)))
#define GB(b) (((u64)1024)*(MB(b)))
typedef struct GameInput {
r32 LastMouseX;
r32 LastMouseY;
r64 MouseX;
r64 MouseY;
r32 Sensitivity;
} GameInput;
typedef struct GameCamera {
r32 MoveSpeed;
r32 PitchAngle;
r32 YawAngle;
Vec3 Pos;
Vec3 Front;
Vec3 Up;
} GameCamera;
typedef struct BufferO {
u32 VAO; // Vertex Array Object
u32 VBO; // Vertex Buffer Object
u32 EBO; // Element Buffer Object
u32 TexO; // Texture Buffer Object
} BufferO;
typedef struct Texture2D {
i32 width;
i32 height;
i32 nrChannels;
unsigned char* data;
} Texture2D;
typedef struct GameMemory {
void *PermanentStorage;
u64 PermanentStorageSize;
DebugArena Arena;
} GameMemory;
typedef struct Rect2 {
Vec2 tl;
Vec2 br;
} Rect2;
typedef struct debug_font_details {
i32 advance;
i32 lsb;
i32 x0, y0, x1, y1;
i32 kern;
r32 lx;
r32 ly;
i32 byte_offset;
i32 baseline;
} debug_font_details;
typedef struct GameState {
GameCamera Camera;
GameInput Input;
GameMemory Memory;
Vec2 WinDimsPx;
Vec2 FieldDimsPx; // play field dimensions
// screen placement management things
Vec2 px_ratio;
Vec2 ScrMidCoords;
Rect2 ScreenCoords;
Rect2 FieldCoords;
} GameState;
#endif
|