summaryrefslogtreecommitdiff
path: root/src/renderer
diff options
context:
space:
mode:
authorOmniscient <17525998+omnisci3nce@users.noreply.github.com>2024-05-10 13:24:05 +1000
committerOmniscient <17525998+omnisci3nce@users.noreply.github.com>2024-05-10 13:24:05 +1000
commitf7944239b793d1d5c49336856965d3a793f99316 (patch)
tree2effd38a16a15aee505eb8c27a231dfbe35c822a /src/renderer
parent3a0557d98ba311b031ad53ceb8fc6025013f65dc (diff)
make core a static and add a default scene to it
Diffstat (limited to 'src/renderer')
-rw-r--r--src/renderer/archive/render_types.h30
-rw-r--r--src/renderer/render_types.h33
2 files changed, 42 insertions, 21 deletions
diff --git a/src/renderer/archive/render_types.h b/src/renderer/archive/render_types.h
index 13a6651..f5ea986 100644
--- a/src/renderer/archive/render_types.h
+++ b/src/renderer/archive/render_types.h
@@ -94,20 +94,20 @@ KITC_DECL_TYPED_ARRAY(animation_clip) // creates "material_darray"
#endif
// // lights
-// typedef struct point_light {
-// vec3 position;
-// f32 constant, linear, quadratic;
-// vec3 ambient;
-// vec3 diffuse;
-// vec3 specular;
-// } point_light;
-
-// typedef struct directional_light {
-// vec3 direction;
-// vec3 ambient;
-// vec3 diffuse;
-// vec3 specular;
-// } directional_light;
+typedef struct point_light {
+ vec3 position;
+ f32 constant, linear, quadratic;
+ vec3 ambient;
+ vec3 diffuse;
+ vec3 specular;
+} point_light;
+
+typedef struct directional_light {
+ vec3 direction;
+ vec3 ambient;
+ vec3 diffuse;
+ vec3 specular;
+} directional_light;
// void point_light_upload_uniforms(shader shader, point_light *light, char index);
// void dir_light_upload_uniforms(shader shader, directional_light *light);
@@ -207,4 +207,4 @@ typedef struct model {
// // typedef enum pipeline_kind {
// // GRAPHICS,
// // COMPUTE,
-// // } pipeline_kind; \ No newline at end of file
+// // } pipeline_kind;
diff --git a/src/renderer/render_types.h b/src/renderer/render_types.h
index 08b9e94..3763967 100644
--- a/src/renderer/render_types.h
+++ b/src/renderer/render_types.h
@@ -116,10 +116,31 @@ KITC_DECL_TYPED_ARRAY(animation_clip)
/** @brief Describes all the data required for the renderer to start executing draws */
typedef struct render_entity {
- buffer_handle index_buffer;
- u32 index_count;
- u32 index_offset;
- buffer_handle vertex_buffer;
- material* material;
+ /* buffer_handle index_buffer; */
+ /* u32 index_count; */
+ /* u32 index_offset; */
+ /* buffer_handle vertex_buffer; */
+ model_handle model;
transform tf;
-} render_entity; \ No newline at end of file
+} render_entity;
+
+#ifndef TYPED_RENDER_ENTITY_ARRAY
+KITC_DECL_TYPED_ARRAY(render_entity)
+#define TYPED_RENDER_ENTITY_ARRAY
+#endif
+
+// --- Lights
+typedef struct point_light {
+ vec3 position;
+ f32 constant, linear, quadratic;
+ vec3 ambient;
+ vec3 diffuse;
+ vec3 specular;
+} point_light;
+
+typedef struct directional_light {
+ vec3 direction;
+ vec3 ambient;
+ vec3 diffuse;
+ vec3 specular;
+} directional_light;