From d63f393b7bcabd7f6569b87a2dedbc8333c47554 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Sun, 30 Oct 2022 17:08:59 +0000 Subject: Setting texture unit on bind Always sets the target unit before binding, allows specifying the unit --- gfx/models/texture.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'gfx/models/texture.cpp') diff --git a/gfx/models/texture.cpp b/gfx/models/texture.cpp index 60e4045..ab04f4f 100644 --- a/gfx/models/texture.cpp +++ b/gfx/models/texture.cpp @@ -31,7 +31,8 @@ Texture::Texture(GLsizei width, GLsizei height, const void * data) } void -Texture::Bind() const +Texture::bind(GLenum unit) const { + glActiveTexture(unit); glBindTexture(GL_TEXTURE_2D, m_texture); } -- cgit v1.2.3