X-Git-Url: http://git.mutantstargoat.com?a=blobdiff_plain;ds=sidebyside;f=src%2Fopengl%2Ftexture-gl.cc;h=80db3ad137052de3b88d1d678a09bd7428643886;hb=f6ceb163227d00d7f97df1fc2dfbdd419c56277e;hp=157d0bb771e5dd51298cb17876193fef4fa4348f;hpb=243eb502c5dc70e586a9e81815234069bf623480;p=demo 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()