From baa4f15774e2eb179a9b6ad6f3b781e0c3e85af3 Mon Sep 17 00:00:00 2001 From: omniscient <17525998+omnisci3nce@users.noreply.github.com> Date: Sat, 27 Jul 2024 17:40:29 +1000 Subject: remove the editor folder --- src/new_render/render.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/new_render/render.c') 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 -- cgit v1.2.3-70-g09d2