projects
/
demo
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
added fog (need to set the fog params)
[demo]
/
src
/
opengl
/
texture-gl.cc
diff --git
a/src/opengl/texture-gl.cc
b/src/opengl/texture-gl.cc
index
157d0bb
..
80db3ad
100644
(file)
--- a/
src/opengl/texture-gl.cc
+++ b/
src/opengl/texture-gl.cc
@@
-56,10
+56,15
@@
void TextureGL::update()
glGenerateMipmap(target);
}
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);
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()
}
void TextureGL::unbind()