summaryrefslogtreecommitdiff
path: root/src/systems
diff options
context:
space:
mode:
Diffstat (limited to 'src/systems')
-rw-r--r--src/systems/physics.c1
-rw-r--r--src/systems/physics.h33
-rw-r--r--src/systems/screenspace.h2
-rw-r--r--src/systems/text.h4
4 files changed, 38 insertions, 2 deletions
diff --git a/src/systems/physics.c b/src/systems/physics.c
new file mode 100644
index 0000000..299c0c1
--- /dev/null
+++ b/src/systems/physics.c
@@ -0,0 +1 @@
+#include "physics.h" \ No newline at end of file
diff --git a/src/systems/physics.h b/src/systems/physics.h
new file mode 100644
index 0000000..5c96c6e
--- /dev/null
+++ b/src/systems/physics.h
@@ -0,0 +1,33 @@
+#pragma once
+
+#include "maths_types.h"
+
+// 'system' means that it gets called per frame
+
+typedef struct physics_settings {
+ f32 gravity_strength;
+} physics_settings;
+
+enum collider_type {
+ cuboid_collider,
+ sphere_collider,
+};
+
+/** @brief generic collider structure */
+typedef struct physics_collider {
+ u64 id; // ? Replace with handle?
+ enum collider_type shape;
+ transform transform;
+ u8 layer;
+ bool on_ground;
+} physics_collider;
+
+typedef struct physics_world {
+ physics_settings settings;
+} physics_world;
+
+physics_world physics_init(physics_settings settings);
+void physics_shutdown(physics_world* phys_world);
+
+/** @brief perform one or more simulation steps */
+void physics_system_update(physics_world* phys_world, f64 deltatime); \ No newline at end of file
diff --git a/src/systems/screenspace.h b/src/systems/screenspace.h
index 2250847..f513148 100644
--- a/src/systems/screenspace.h
+++ b/src/systems/screenspace.h
@@ -37,7 +37,7 @@ KITC_DECL_TYPED_ARRAY(draw_cmd)
typedef struct screenspace_state {
u32 rect_vbo;
u32 rect_vao;
- shader rect_shader;
+ // shader rect_shader;
draw_cmd_darray* draw_cmd_buf;
} screenspace_state;
diff --git a/src/systems/text.h b/src/systems/text.h
index 19248a6..4fac0b8 100644
--- a/src/systems/text.h
+++ b/src/systems/text.h
@@ -5,9 +5,11 @@
#include <stb_truetype.h>
+#include "cleanroom/types.h"
#include "darray.h"
#include "defines.h"
#include "render_types.h"
+#include "ral.h"
struct core;
@@ -29,7 +31,7 @@ KITC_DECL_TYPED_ARRAY(draw_text_packet)
typedef struct text_system_state {
font default_font;
- shader glyph_shader;
+ shader_handle glyph_shader;
u32 glyph_vbo;
u32 glyph_vao;
draw_text_packet_darray *draw_cmd_buf;