From 8eb38ac437cefabd94092d7b3904c3c1ad4ceb1c Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Fri, 19 Jan 2024 22:34:42 -0500 Subject: [PATCH] Make use of bound_shader. --- .../xcschemes/Clock Signal Kiosk.xcscheme | 2 +- Outputs/OpenGL/Primitives/Shader.cpp | 13 ++++++------- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/OSBindings/Mac/Clock Signal.xcodeproj/xcshareddata/xcschemes/Clock Signal Kiosk.xcscheme b/OSBindings/Mac/Clock Signal.xcodeproj/xcshareddata/xcschemes/Clock Signal Kiosk.xcscheme index 5be13a225..94fafe137 100644 --- a/OSBindings/Mac/Clock Signal.xcodeproj/xcshareddata/xcschemes/Clock Signal Kiosk.xcscheme +++ b/OSBindings/Mac/Clock Signal.xcodeproj/xcshareddata/xcschemes/Clock Signal Kiosk.xcscheme @@ -53,7 +53,7 @@ logger; } @@ -107,20 +106,20 @@ void Shader::init(const std::string &vertex_shader, const std::string &fragment_ } Shader::~Shader() { -// if(bound_shader == this) Shader::unbind(); + if(bound_shader == this) Shader::unbind(); glDeleteProgram(shader_program_); } void Shader::bind() const { -// if(bound_shader != this) { + if(bound_shader != this) { test_gl(glUseProgram, shader_program_); -// bound_shader = this; -// } + bound_shader = this; + } flush_functions(); } void Shader::unbind() { -// bound_shader = nullptr; + bound_shader = nullptr; test_gl(glUseProgram, 0); }