From dfb6adbcbcc7d50b770b6d5ea82efdd8f8c32e25 Mon Sep 17 00:00:00 2001 From: omniscient <17525998+omnisci3nce@users.noreply.github.com> Date: Sat, 5 Oct 2024 12:48:05 +1000 Subject: delete documentation workflow --- archive/src/render/skybox.h | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 archive/src/render/skybox.h (limited to 'archive/src/render/skybox.h') diff --git a/archive/src/render/skybox.h b/archive/src/render/skybox.h new file mode 100644 index 0000000..c2ef3a2 --- /dev/null +++ b/archive/src/render/skybox.h @@ -0,0 +1,41 @@ +/** + * @brief + */ + +#pragma once +#include "camera.h" +#include "defines.h" +#include "ral_impl.h" +#include "render_types.h" + +typedef struct Skybox { + Mesh cube; + TextureHandle texture; + GPU_Pipeline* pipeline; // "shader" +} Skybox; + +PUB Skybox Skybox_Create(const char** face_paths, int n); // should always pass n = 6 for now + +PUB void Skybox_Draw(Skybox* skybox, Camera camera); + +typedef struct SkyboxUniforms { + TextureHandle cubemap; +} SkyboxUniforms; + +static ShaderDataLayout Skybox_GetLayout(void* data) { + SkyboxUniforms* d = (SkyboxUniforms*)data; // cold cast + bool has_data = data != NULL; + + ShaderBinding b1 = { + .label = "cubeMap", + .vis = VISIBILITY_FRAGMENT, + .kind = BINDING_TEXTURE, + }; + + if (has_data) { + b1.data.texture.handle = d->cubemap; + } + return (ShaderDataLayout){ .bindings = { b1 }, .binding_count = 1 }; +} + +Skybox Skybox_Default(); \ No newline at end of file -- cgit v1.2.3-70-g09d2