diff options
Diffstat (limited to 'src/render')
-rw-r--r-- | src/render/render.h | 10 | ||||
-rw-r--r-- | src/render/shader_layouts.h | 2 | ||||
-rw-r--r-- | src/render/skybox.c | 14 |
3 files changed, 11 insertions, 15 deletions
diff --git a/src/render/render.h b/src/render/render.h index 0aee51c..5dc3853 100644 --- a/src/render/render.h +++ b/src/render/render.h @@ -3,13 +3,13 @@ */ #pragma once +#include "camera.h" #include "defines.h" #include "grid.h" #include "maths_types.h" #include "ral_types.h" #include "render_types.h" #include "shadows.h" -#include "camera.h" typedef struct Renderer Renderer; typedef struct GLFWwindow GLFWwindow; @@ -78,7 +78,8 @@ MeshHandle Mesh_Insert(Mesh* mesh); MaterialHandle Material_Insert(Material* material); /** @brief gets render entities from a model and pushes them into a dynamic array for rendering */ -size_t ModelExtractRenderEnts(RenderEnt_darray* entities, ModelHandle model_handle, Mat4 affine, RenderEntityFlags flags); +size_t ModelExtractRenderEnts(RenderEnt_darray* entities, ModelHandle model_handle, Mat4 affine, + RenderEntityFlags flags); // --- Drawing @@ -129,8 +130,9 @@ void Render_SetRenderMode(RenderMode mode); // typedef struct Renderer Renderer; -// /** @brief Produces a smaller set of only those meshes visible in the camera frustum on the CPU */ -// Cull_Result Frame_Cull(Renderer* ren, RenderEnt* entities, size_t entity_count, Camera* camera); +// /** @brief Produces a smaller set of only those meshes visible in the camera frustum on the CPU +// */ Cull_Result Frame_Cull(Renderer* ren, RenderEnt* entities, size_t entity_count, Camera* +// camera); // Cull_Result Frame_Cull(Renderer* ren, RenderEnt* entities, size_t entity_count, Camera* camera) { // // TODO: u32 chunk_count = Tpool_GetNumWorkers(); diff --git a/src/render/shader_layouts.h b/src/render/shader_layouts.h index 09cf129..ef94c89 100644 --- a/src/render/shader_layouts.h +++ b/src/render/shader_layouts.h @@ -67,4 +67,4 @@ static ShaderDataLayout Binding_Lights_GetLayout(void* data) { b1.data.bytes.data = d; } return (ShaderDataLayout){ .bindings = { b1 }, .binding_count = 1 }; -}
\ No newline at end of file +} diff --git a/src/render/skybox.c b/src/render/skybox.c index cc5797f..b228c82 100644 --- a/src/render/skybox.c +++ b/src/render/skybox.c @@ -39,7 +39,9 @@ static const char* faces[6] = { "assets/demo/skybox/right.jpg", "assets/demo/sky Skybox Skybox_Create(const char** face_paths, int n) { INFO("Creating a skybox"); - assert(n == 6); // ! we're only supporting a full cubemap for now + CASSERT_MSG( + n == 6, + "We only support full cubemaps for now"); // ! we're only supporting a full cubemap for now // -- cube verts Geometry geom = { .format = VERTEX_POS_ONLY, // doesnt matter @@ -59,12 +61,8 @@ Skybox Skybox_Create(const char** face_paths, int n) { GPU_Texture* tex = GPU_TextureAlloc(&handle); glBindTexture(GL_TEXTURE_CUBE_MAP, tex->id); - int width, height, nrChannels; - // unsigned char *data; for (unsigned int i = 0; i < n; i++) { - TextureData data = TextureDataLoad( - face_paths[i], - false); // stbi_load(textures_faces[i].c_str(), &width, &height, &nrChannels, 0); + TextureData data = TextureDataLoad(face_paths[i], false); assert(data.description.format == TEXTURE_FORMAT_8_8_8_RGB_UNORM); glTexImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_X + i, 0, GL_RGB, data.description.extents.x, data.description.extents.y, 0, GL_RGB, GL_UNSIGNED_BYTE, data.image_data); @@ -91,10 +89,6 @@ Skybox Skybox_Create(const char** face_paths, int n) { ERROR_EXIT("Failed to load shaders from disk") } - // VertexDescription pos_only = { .debug_label = "Position only verts" }; - // VertexDesc_AddAttr(&pos_only, "inPos", ATTR_F32x3); - // pos_only.use_full_vertex_size = true; - ShaderDataLayout camera_data = Binding_Camera_GetLayout(NULL); ShaderDataLayout shader_data = Skybox_GetLayout(NULL); |