From fed710754296111a51b1b99b40a3c5e5dc873895 Mon Sep 17 00:00:00 2001 From: Adrian Kummerlaender Date: Tue, 18 Dec 2018 17:04:18 +0100 Subject: Purify collide shader i.e. move fluid vertex placement to appropriate vertex shader. Do not amplify or shift fluid moments in any way prior to passing it to the display pipeline. --- src/shader/wrap/graphic_shader.cc | 6 ++++++ src/shader/wrap/graphic_shader.h | 1 + 2 files changed, 7 insertions(+) (limited to 'src/shader/wrap') diff --git a/src/shader/wrap/graphic_shader.cc b/src/shader/wrap/graphic_shader.cc index c891730..20fc222 100644 --- a/src/shader/wrap/graphic_shader.cc +++ b/src/shader/wrap/graphic_shader.cc @@ -42,6 +42,12 @@ GLuint GraphicShader::setUniform(const std::string& name, int value) const { return id; } +GLuint GraphicShader::setUniform(const std::string& name, GLuint value) const { + GLuint id = util::getUniform(_id, name); + glUniform1ui(id, value); + return id; +} + GLuint GraphicShader::setUniform(const std::string& name, const std::vector& v) const { GLuint id = util::getUniform(_id, name); glUniform1iv(id, v.size(), reinterpret_cast(v.data())); diff --git a/src/shader/wrap/graphic_shader.h b/src/shader/wrap/graphic_shader.h index dcae6db..83fca34 100644 --- a/src/shader/wrap/graphic_shader.h +++ b/src/shader/wrap/graphic_shader.h @@ -25,6 +25,7 @@ public: ~GraphicShader(); GLuint setUniform(const std::string& name, int value) const; + GLuint setUniform(const std::string& name, GLuint value) const; GLuint setUniform(const std::string& name, const std::vector& v) const; GLuint setUniform(const std::string& name, glm::mat4& M) const; }; -- cgit v1.2.3