]> git.lizzy.rs Git - dragonblocks_alpha.git/blob - src/client/scene.h
1a27162fd345fda502842417c636523afb8a3268
[dragonblocks_alpha.git] / src / client / scene.h
1 #ifndef _SCENE_H_
2 #define _SCENE_H_
3
4 #include <stdbool.h>
5 #include <pthread.h>
6 #include <linmath.h/linmath.h>
7 #include <dragontype/bintree.h>
8 #include <dragontype/list.h>
9 #include <dragontype/number.h>
10 #include "client/object.h"
11
12 extern struct Scene
13 {
14         List objects;
15         Bintree render_objects;
16         pthread_mutex_t mtx;
17         GLuint prog;
18         GLint loc_model;
19         GLint loc_VP;
20         GLint loc_daylight;
21         GLint loc_lightDir;
22         GLint loc_cameraPos;
23         GLint max_texture_units;
24         mat4x4 VP;
25         mat4x4 projection;
26         f32 fov;
27         f32 render_distance;
28 } scene;
29
30 bool scene_init();
31 void scene_deinit();
32 void scene_add_object(Object *obj);
33 void scene_render(f64 dtime);
34 void scene_on_resize(int width, int height);
35 GLuint scene_get_max_texture_units();
36 void scene_get_view_proj(mat4x4 target);
37
38 #endif