From 8550c5d41ee84bcbf5e355c5adb6659166e3eb62 Mon Sep 17 00:00:00 2001 From: omniscient <17525998+omnisci3nce@users.noreply.github.com> Date: Wed, 31 Jul 2024 12:38:12 +1000 Subject: start on immediate drawing --- src/new_render/render.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'src/new_render/render.c') diff --git a/src/new_render/render.c b/src/new_render/render.c index f83e573..fd5e1c2 100644 --- a/src/new_render/render.c +++ b/src/new_render/render.c @@ -5,9 +5,11 @@ #include "render.h" #include #include +#include #include "camera.h" #include "core.h" #include "grid.h" +#include "immdraw.h" #include "log.h" #include "maths.h" #include "maths_types.h" @@ -45,6 +47,7 @@ struct Renderer { Shadow_Storage* shadows; Terrain_Storage* terrain; Grid_Storage* grid; + Immdraw_Storage* immediate; // Text_Storage* text; ResourcePools* resource_pools; Mesh_pool mesh_pool; @@ -133,17 +136,20 @@ bool Renderer_Init(RendererConfig config, Renderer* ren, GLFWwindow** out_window // create our renderpasses ren->shadows = malloc(sizeof(Shadow_Storage)); - // Shadow_Init(ren->shadows, 1024, 1024); + Shadow_Init(ren->shadows, 1024, 1024); - ren->pbr = malloc(sizeof(PBR_Storage)); + ren->pbr = calloc(1, sizeof(PBR_Storage)); PBR_Init(ren->pbr); - ren->terrain = malloc(sizeof(Terrain_Storage)); + ren->terrain = calloc(1, sizeof(Terrain_Storage)); Terrain_Init(ren->terrain); ren->grid = calloc(1, sizeof(Grid_Storage)); Grid_Init(ren->grid); + ren->immediate = calloc(1, sizeof(Immdraw_Storage)); + Immdraw_Init(ren->immediate); + // load default textures ren->white_1x1 = TextureLoadFromFile("assets/textures/white1x1.png"); // TODO: black_1x1 -- cgit v1.2.3-70-g09d2