summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authoromniscient <17525998+omnisci3nce@users.noreply.github.com>2024-05-09 01:47:46 +1000
committeromniscient <17525998+omnisci3nce@users.noreply.github.com>2024-05-09 01:47:46 +1000
commit6f94d87d74524b8726cf6f4b9b3a7f64562191e9 (patch)
tree1b3154ee6f36fa88b75c5a1db186837670f3f22c /include
parentf1b48b0bbbebb92b9600dac41848304b82f0b3dd (diff)
defining minimal API necessary for OCaml side
Diffstat (limited to 'include')
-rw-r--r--include/celeritas.h63
1 files changed, 63 insertions, 0 deletions
diff --git a/include/celeritas.h b/include/celeritas.h
new file mode 100644
index 0000000..425436c
--- /dev/null
+++ b/include/celeritas.h
@@ -0,0 +1,63 @@
+/**
+ * @file celeritas.h
+ * @author your name (you@domain.com)
+ * @brief
+ * @version 0.1
+ * @date 2024-05-09
+ *
+ * @copyright Copyright (c) 2024
+ *
+ */
+
+/* The Goal of this file is to test ocaml-bindgen on it to start moving development over into OCaml */
+
+#include <stdbool.h>
+#include <stdint.h>
+
+
+// Forward Declarations
+typedef struct core core;
+
+// Handles
+typedef uint32_t model_handle;
+
+// Maths
+typedef struct vec2 { float x, y; } vec2;
+typedef struct vec3 { float x, y, z; } vec3;
+typedef struct vec4 { float x, y, z, w; } vec4;
+typedef struct mat4 { float data[16]; } mat4;
+typedef struct transform3d { vec3 translation; vec4 rotation; float scale; } transform3d;
+
+// Lifecycle functions
+void core_bringup();
+void core_shutdown();
+bool should_window_close();
+
+void render_frame_begin();
+void render_frame_draw();
+void render_frame_end();
+
+// Assets
+model_handle model_load(const char* filepath);
+
+// Rendering
+typedef struct render_entity {
+ model_handle model;
+ // TODO: material
+ transform3d transform;
+} render_entity;
+
+// Scene
+typedef struct directional_light {} directional_light;
+typedef struct point_light {} point_light;
+void scene_add_dir_light(directional_light light);
+void scene_add_point_light(directional_light light);
+void scene_add_model(model_handle model, transform3d transform);
+bool scene_remove_model(model_handle model);
+
+void scene_set_model_transform(model_handle model, transform3d new_transform);
+void scene_set_camera(vec3 pos, vec3 front);
+
+// Immediate mode drawing
+
+// Input \ No newline at end of file