X-Git-Url: http://git.mutantstargoat.com?p=demo;a=blobdiff_plain;f=src%2Fopengl%2Ftexture-gl.cc;h=80db3ad137052de3b88d1d678a09bd7428643886;hp=157d0bb771e5dd51298cb17876193fef4fa4348f;hb=f1c3197c3e035f4be0e10ff6a8d0cf0339824177;hpb=978140660bed8a4bbe782dc5ca0516a80e1ba233 diff --git a/src/opengl/texture-gl.cc b/src/opengl/texture-gl.cc index 157d0bb..80db3ad 100644 --- a/src/opengl/texture-gl.cc +++ b/src/opengl/texture-gl.cc @@ -56,10 +56,15 @@ void TextureGL::update() glGenerateMipmap(target); } -void TextureGL::bind() +void TextureGL::bind(int texture_unit) { + glActiveTexture(GL_TEXTURE0 + texture_unit); + unsigned int target = is_cubemap() ? GL_TEXTURE_CUBE_MAP : GL_TEXTURE_2D; glBindTexture(target, tex); + + //TODO: (not needed for now) if I ever use textures outside the Texture class + //glActiveTexture(GL_TEXTURE0); } void TextureGL::unbind()