summaryrefslogtreecommitdiff
path: root/examples/cube/ex_cube.c
diff options
context:
space:
mode:
authorOmniscient <17525998+omnisci3nce@users.noreply.github.com>2024-05-29 14:50:49 +1000
committerOmniscient <17525998+omnisci3nce@users.noreply.github.com>2024-05-29 14:50:49 +1000
commitbaf787b9eb742b0c52ecf8c9ae319dbfb4ea0f1b (patch)
treea3da522dda3c173bc7de13842c98bbb419324efa /examples/cube/ex_cube.c
parent824579234685171f0ca78674c7c18dfe6b43fe6e (diff)
opengl clear color working
Diffstat (limited to 'examples/cube/ex_cube.c')
-rw-r--r--examples/cube/ex_cube.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/examples/cube/ex_cube.c b/examples/cube/ex_cube.c
index b87071f..7b0ab48 100644
--- a/examples/cube/ex_cube.c
+++ b/examples/cube/ex_cube.c
@@ -68,8 +68,14 @@ int main() {
gpu_renderpass_desc pass_description = {};
gpu_renderpass* renderpass = gpu_renderpass_create(&pass_description);
- str8 vert_path = str8lit("build/linux/x86_64/debug/cube.vert.spv");
- str8 frag_path = str8lit("build/linux/x86_64/debug/cube.frag.spv");
+ str8 vert_path, frag_path;
+#ifdef CEL_REND_BACKEND_OPENGL
+ vert_path = str8lit("assets/shaders/blinn_phong.vert");
+ frag_path = str8lit("assets/shaders/blinn_phong.frag");
+#else
+ vert_path = str8lit("build/linux/x86_64/debug/cube.vert.spv");
+ frag_path = str8lit("build/linux/x86_64/debug/cube.frag.spv");
+#endif
str8_opt vertex_shader = str8_from_file(&scratch, vert_path);
str8_opt fragment_shader = str8_from_file(&scratch, frag_path);
if (!vertex_shader.has_value || !fragment_shader.has_value) {