blob: df6fead9629cd2669941718c5c8be019c47d0d0d (
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
|
#ifndef STATE_TITLESCREEN_H
#define STATE_TITLESCREEN_H
#include <stdbool.h>
#include <daw/types.h>
#include <daw/rendering.h>
#include <daw/resources.h>
#include <daw/input.h>
#define CGLM_FORCE_DEPTH_ZERO_TO_ONE 1
#include <cglm/cglm.h>
#include <worldgen.h>
struct assimp_mesh {
usize vertices_len;
usize indices_len;
usize normals_len;
f32* vertices;
u32* indices;
f32* normals;
};
struct object_physics {
vec3 pos;
vec3 vel;
vec3 acc;
};
struct entity_info {
struct object_physics p;
// i16 health
// .. etc
};
typedef struct mainstate_state {
/* Resources */
Shader shaders[10];
struct assimp_mesh meshes[2];
RenderBatch terrain;
RenderObject objects[10];
u32 world[WORLD_SIZE * CHUNK_SIZE];
i_ctx input_ctx;
binding_t input_bindings[14];
vec3 cam_dir;
f32 cam_dir_dt;
vec3 cam_pos;
vec3 cam_speed;
vec3 cam_acc;
Camera c;
f64 fov;
Resources resources;
f64 height;
struct entity_info player;
} mainstate_state;
#endif
|