summaryrefslogtreecommitdiff
path: root/src/new_render/render.c
diff options
context:
space:
mode:
authoromniscient <17525998+omnisci3nce@users.noreply.github.com>2024-07-27 17:40:29 +1000
committeromniscient <17525998+omnisci3nce@users.noreply.github.com>2024-07-27 17:40:29 +1000
commitbaa4f15774e2eb179a9b6ad6f3b781e0c3e85af3 (patch)
tree71c7cbc81f86d720e730c0d314b9b295d2f8141d /src/new_render/render.c
parentaa0fe8457cfff9c47c0c9fa4a1c86a79c7cbf9c5 (diff)
remove the editor folder
Diffstat (limited to 'src/new_render/render.c')
-rw-r--r--src/new_render/render.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/new_render/render.c b/src/new_render/render.c
index 235f1cb..77a3269 100644
--- a/src/new_render/render.c
+++ b/src/new_render/render.c
@@ -37,6 +37,7 @@ struct Renderer {
GPU_Swapchain swapchain;
GPU_Renderpass* default_renderpass;
bool frame_aborted;
+ RenderMode render_mode;
RenderScene scene;
PBR_Storage* pbr;
Shadow_Storage* shadows;
@@ -54,6 +55,7 @@ Renderer* get_renderer() { return g_core.renderer; }
bool Renderer_Init(RendererConfig config, Renderer* ren, GLFWwindow** out_window,
GLFWwindow* optional_window) {
INFO("Renderer init");
+ ren->render_mode = RENDER_MODE_DEFAULT;
ren->frame_arena = arena_create(malloc(FRAME_ARENA_SIZE), FRAME_ARENA_SIZE);
@@ -293,6 +295,7 @@ TextureHandle Render_GetWhiteTexture() {
return ren->white_1x1;
}
+/** @return an arena allocator that gets cleared at the beginning of every render frame */
arena* Render_GetFrameArena() {
Renderer* ren = Core_GetRenderer(&g_core);
return &ren->frame_arena;
@@ -305,4 +308,9 @@ Mesh_pool* Render_GetMeshPool() {
Material_pool* Render_GetMaterialPool() {
Renderer* ren = Core_GetRenderer(&g_core);
return &ren->material_pool;
+}
+
+void Render_SetRenderMode(RenderMode mode) {
+ Renderer* ren = Core_GetRenderer(&g_core);
+ ren->render_mode = mode;
} \ No newline at end of file