From ddf657d5ed05ec50bb986a9d8ba95141ac5a2456 Mon Sep 17 00:00:00 2001 From: Abdelrahman Date: Sun, 22 Sep 2024 15:11:47 +0100 Subject: [PATCH] Only send offset uniform if it was found --- src/main.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main.cc b/src/main.cc index c8e7618..87c6427 100644 --- a/src/main.cc +++ b/src/main.cc @@ -119,7 +119,7 @@ int init(App &app) { glGetString(GL_SHADING_LANGUAGE_VERSION) ); - app.offset_modifier = 0.02f; + app.offset_modifier = 0.02f; return EXIT_CODE_SUCCESS; } @@ -234,7 +234,9 @@ void run_main_loop(App &app) { glClear(GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT); glUseProgram(app.shader_program); - glUniform1f(app.u_offset_idx, app.offset); + if (app.u_offset_idx >= 0) { + glUniform1f(app.u_offset_idx, app.offset); + } // End pre draw setup // Draw call