summaryrefslogtreecommitdiff
path: root/src/new_render
diff options
context:
space:
mode:
Diffstat (limited to 'src/new_render')
-rw-r--r--src/new_render/render.c8
-rw-r--r--src/new_render/render.h6
2 files changed, 11 insertions, 3 deletions
diff --git a/src/new_render/render.c b/src/new_render/render.c
index fd5e1c2..c180597 100644
--- a/src/new_render/render.c
+++ b/src/new_render/render.c
@@ -284,6 +284,12 @@ void Geometry_Destroy(Geometry* geometry) {
Vertex_darray_free(geometry->vertices);
}
}
+PUB MeshHandle Mesh_Insert(Mesh* mesh) {
+ return Mesh_pool_insert(Render_GetMeshPool(), mesh);
+}
+PUB MaterialHandle Material_Insert(Material* material) {
+ return Material_pool_insert(Render_GetMaterialPool(), material);
+}
size_t ModelExtractRenderEnts(RenderEnt_darray* entities, ModelHandle model_handle, Mat4 affine,
RenderEntityFlags flags) {
@@ -348,4 +354,4 @@ Material_pool* Render_GetMaterialPool() {
void Render_SetRenderMode(RenderMode mode) {
Renderer* ren = Core_GetRenderer(&g_core);
ren->render_mode = mode;
-} \ No newline at end of file
+}
diff --git a/src/new_render/render.h b/src/new_render/render.h
index 8f3ac2a..7fbc0a7 100644
--- a/src/new_render/render.h
+++ b/src/new_render/render.h
@@ -13,7 +13,7 @@
typedef struct Renderer Renderer;
typedef struct GLFWwindow GLFWwindow;
typedef struct RendererConfig {
- char window_name[256];
+ const char* window_name;
u32 scr_width, scr_height;
Vec3 clear_colour;
} RendererConfig;
@@ -62,6 +62,8 @@ PUB ModelHandle ModelLoad(const char* debug_name, const char* filepath);
PUB Mesh Mesh_Create(Geometry* geometry, bool free_on_upload);
PUB void Mesh_Delete(Mesh* mesh);
void Geometry_Destroy(Geometry* geometry);
+MeshHandle Mesh_Insert(Mesh* mesh);
+MaterialHandle Material_Insert(Material* material);
/** @brief gets render entities from a model and pushes them into a dynamic array for rendering */
size_t ModelExtractRenderEnts(RenderEnt_darray* entities, ModelHandle model_handle, Mat4 affine, RenderEntityFlags flags);
@@ -92,4 +94,4 @@ Mesh_pool* Render_GetMeshPool();
Material_pool* Render_GetMaterialPool();
// --- Setters
-void Render_SetRenderMode(RenderMode mode); \ No newline at end of file
+void Render_SetRenderMode(RenderMode mode);