summaryrefslogtreecommitdiff
path: root/src/new_render
diff options
context:
space:
mode:
Diffstat (limited to 'src/new_render')
-rw-r--r--src/new_render/pbr.c4
-rw-r--r--src/new_render/render.c10
-rw-r--r--src/new_render/render.h3
-rw-r--r--src/new_render/skybox.c4
4 files changed, 10 insertions, 11 deletions
diff --git a/src/new_render/pbr.c b/src/new_render/pbr.c
index 2393aa9..6df4e97 100644
--- a/src/new_render/pbr.c
+++ b/src/new_render/pbr.c
@@ -34,8 +34,8 @@ GPU_Pipeline* PBR_PipelineCreate(GPU_Renderpass* rpass) {
// if (!vertex_shader.has_value || !fragment_shader.has_value) {
// ERROR_EXIT("Failed to load shaders from disk")
// }
- char* vert_shader = string_from_file(vert_path);
- char* frag_shader = string_from_file(frag_path);
+ char* vert_shader = string_from_file(vert_path);
+ char* frag_shader = string_from_file(frag_path);
ShaderData camera_data = { .get_layout = &Binding_Camera_GetLayout };
ShaderData model_data = { .get_layout = &Binding_Model_GetLayout };
diff --git a/src/new_render/render.c b/src/new_render/render.c
index c8660a3..cfe68d7 100644
--- a/src/new_render/render.c
+++ b/src/new_render/render.c
@@ -4,7 +4,6 @@
#include "render.h"
#include <assert.h>
-#include "glad/glad.h"
#include <glfw3.h>
#include "camera.h"
#include "core.h"
@@ -45,7 +44,8 @@ struct Renderer {
Renderer* get_renderer() { return g_core.renderer; }
-bool Renderer_Init(RendererConfig config, Renderer* ren, GLFWwindow** out_window, GLFWwindow* optional_window) {
+bool Renderer_Init(RendererConfig config, Renderer* ren, GLFWwindow** out_window,
+ GLFWwindow* optional_window) {
INFO("Renderer init");
ren->frame_arena = arena_create(malloc(FRAME_ARENA_SIZE), FRAME_ARENA_SIZE);
@@ -65,14 +65,14 @@ bool Renderer_Init(RendererConfig config, Renderer* ren, GLFWwindow** out_window
// NOTE: all platforms use GLFW at the moment but thats subject to change
glfwInit();
- #if defined(CEL_REND_BACKEND_OPENGL)
+#if defined(CEL_REND_BACKEND_OPENGL)
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 4);
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 1);
glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE);
- #elif defined(CEL_REND_BACKEND_VULKAN)
+#elif defined(CEL_REND_BACKEND_VULKAN)
glfwWindowHint(GLFW_CLIENT_API, GLFW_NO_API);
- #endif
+#endif
window = glfwCreateWindow(config.scr_width, config.scr_height, config.window_name, NULL, NULL);
INFO("Window created");
diff --git a/src/new_render/render.h b/src/new_render/render.h
index 1f80290..2df684c 100644
--- a/src/new_render/render.h
+++ b/src/new_render/render.h
@@ -28,7 +28,8 @@ typedef struct RenderCtx {
// --- Lifecycle
-PUB bool Renderer_Init(RendererConfig config, Renderer* renderer, GLFWwindow** out_window, GLFWwindow* optional_window);
+PUB bool Renderer_Init(RendererConfig config, Renderer* renderer, GLFWwindow** out_window,
+ GLFWwindow* optional_window);
PUB void Renderer_Shutdown(Renderer* renderer);
PUB size_t Renderer_GetMemReqs();
void Render_WindowSizeChanged(GLFWwindow* window, i32 new_width, i32 new_height);
diff --git a/src/new_render/skybox.c b/src/new_render/skybox.c
index 8ba4da9..5456401 100644
--- a/src/new_render/skybox.c
+++ b/src/new_render/skybox.c
@@ -122,9 +122,7 @@ Skybox Skybox_Create(const char** face_paths, int n) {
return (Skybox){ .cube = cube, .texture = handle, .pipeline = pipeline };
}
-Skybox Skybox_Default() {
- return Skybox_Create(faces, 6);
-}
+Skybox Skybox_Default() { return Skybox_Create(faces, 6); }
void Skybox_Draw(Skybox* skybox, Camera camera) {
GPU_CmdEncoder* enc = GPU_GetDefaultEncoder();