From 81f340d7fa7360c3f01c0c3c06e759e76ede9933 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Sat, 18 Dec 2021 18:35:40 +0000 Subject: Need a way to select the UI shader --- gfx/gl/uiShader.cpp | 5 +++++ gfx/gl/uiShader.h | 1 + 2 files changed, 6 insertions(+) (limited to 'gfx') diff --git a/gfx/gl/uiShader.cpp b/gfx/gl/uiShader.cpp index b3fee14..1c2a0e1 100644 --- a/gfx/gl/uiShader.cpp +++ b/gfx/gl/uiShader.cpp @@ -14,3 +14,8 @@ UIShader::UIShader(size_t width, size_t height) : program {uiShader_vs.compile() glUniformMatrix4fv(loc, 1, GL_FALSE, glm::value_ptr(uiProjection)); } } +void +UIShader::use() const +{ + glUseProgram(program.m_program); +} diff --git a/gfx/gl/uiShader.h b/gfx/gl/uiShader.h index b251136..45ccc23 100644 --- a/gfx/gl/uiShader.h +++ b/gfx/gl/uiShader.h @@ -8,6 +8,7 @@ class UIShader { public: UIShader(std::size_t width, std::size_t height); + void use() const; private: class UIProgramHandle : public ProgramHandleBase { -- cgit v1.2.3