diff options
author | omnisci3nce <omniscient.oce@gmail.com> | 2024-07-12 12:47:07 +1000 |
---|---|---|
committer | omnisci3nce <omniscient.oce@gmail.com> | 2024-07-12 12:47:07 +1000 |
commit | f74cf52946f4e569a26bc81105537b40be95c2c7 (patch) | |
tree | 1d000367350d0e28eb7cfbc800286a0ed30a4e6c /src/new_render/render.h | |
parent | fedba7ff68924ff50022405fc9103a5acf7013fe (diff) |
wip: big makeover
Diffstat (limited to 'src/new_render/render.h')
-rw-r--r-- | src/new_render/render.h | 40 |
1 files changed, 39 insertions, 1 deletions
diff --git a/src/new_render/render.h b/src/new_render/render.h index 93b2366..7c6a4a5 100644 --- a/src/new_render/render.h +++ b/src/new_render/render.h @@ -4,9 +4,47 @@ #pragma once #include "defines.h" +#include "maths_types.h" +#include "ral_types.h" +#include "render_types.h" typedef struct Renderer Renderer; -typedef struct RendererConfig RendererConfig; +typedef struct RendererConfig { + char window_name[256]; + u32 scr_width, scr_height; + Vec3 clear_colour; +} RendererConfig; + +typedef struct RenderCtx { + Mat4 view; + Mat4 projection; +} RenderCtx; + +// --- Lifecycle PUB bool Renderer_Init(RendererConfig config, Renderer* renderer); PUB void Renderer_Shutdown(Renderer* renderer); + +// NOTE: All of these functions grab the Renderer instance off the global Core +PUB void Render_FrameBegin(Renderer* renderer); +PUB void Render_FrameEnd(Renderer* renderer); +PUB void Render_FrameDraw(Renderer* renderer); + +// --- Resources + +PUB TextureHandle TextureUpload(); +PUB ModelHandle ModelLoad(const char* name, const char* filepath); + +// --- Rendering Data + +PUB Mesh Mesh_Create(Geometry* geometry, bool free_on_upload); +PUB void Mesh_Delete(Mesh* mesh); + +// --- Drawing + +// NOTE: These functions use the globally bound camera in RenderScene +PUB void DrawMesh(Mesh* mesh, Material* material, Mat4 model); + +/** @brief the renderer does some internal bookkeeping for terrain so we use the terrain + stored on the Renderer rather than accept it as a parameter */ +PUB void Render_DrawTerrain(); |