added fog (need to set the fog params)
[demo] / src / opengl / texture-gl.cc
index 157d0bb..80db3ad 100644 (file)
@@ -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()