Commit 690a06cd authored by Janis Born's avatar Janis Born

allow setting TextureBuffers as ShaderProgram uniforms

parent 6a4b434c
...@@ -47,6 +47,7 @@ ...@@ -47,6 +47,7 @@
#include <ACGL/OpenGL/GL.hh> #include <ACGL/OpenGL/GL.hh>
#include <ACGL/OpenGL/Objects/Shader.hh> #include <ACGL/OpenGL/Objects/Shader.hh>
#include <ACGL/OpenGL/Objects/Texture.hh> #include <ACGL/OpenGL/Objects/Texture.hh>
#include <ACGL/OpenGL/Objects/TextureBuffer.hh>
#include <ACGL/OpenGL/Data/LocationMappings.hh> #include <ACGL/OpenGL/Data/LocationMappings.hh>
#include <ACGL/Math/Math.hh> #include <ACGL/Math/Math.hh>
...@@ -255,8 +256,9 @@ public: ...@@ -255,8 +256,9 @@ public:
#endif // OpenGL >= 4.0 #endif // OpenGL >= 4.0
//! sets a texture uniform to a given texture unit and also binds the texture to the same unit //! sets a texture uniform to a given texture unit and also binds the texture to the same unit
inline void setTexture (GLint _location, const ConstSharedTextureBase& _texture, GLint _unit) const { glUniform1i(_location, _unit); _texture->bind(_unit); } inline void setTexture (GLint _location, const ConstSharedTextureBase& _texture, GLint _unit) const { glUniform1i(_location, _unit); _texture->bind(_unit); }
inline void setTexture (const std::string& _nameInShader, const ConstSharedTextureBase& _texture, GLint _unit) const { setUniform( getUniformLocation(_nameInShader), (GLint) _unit); _texture->bind(_unit); } inline void setTexture (const std::string& _nameInShader, const ConstSharedTextureBase& _texture, GLint _unit) const { setUniform( getUniformLocation(_nameInShader), (GLint) _unit); _texture->bind(_unit); }
inline void setTexture (const std::string& _nameInShader, const ConstSharedTextureBuffer& _texture, GLint _unit) const { setUniform( getUniformLocation(_nameInShader), (GLint) _unit); _texture->bindTexture(_unit); }
#if (ACGL_OPENGL_VERSION >= 41) #if (ACGL_OPENGL_VERSION >= 41)
// DSA versions: // DSA versions:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment