projects
/
ld37_one_room
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
backported changes from museum project
[ld37_one_room]
/
src
/
texture.cc
diff --git
a/src/texture.cc
b/src/texture.cc
index
ff4d1b5
..
18dd28f
100644
(file)
--- a/
src/texture.cc
+++ b/
src/texture.cc
@@
-38,6
+38,7
@@
void bind_texture(Texture *tex, int tunit)
} else {
glActiveTexture(GL_TEXTURE0 + tunit);
glBindTexture(cur_target[tunit], 0);
} else {
glActiveTexture(GL_TEXTURE0 + tunit);
glBindTexture(cur_target[tunit], 0);
+ glDisable(cur_target[tunit]);
assert(glGetError() == GL_NO_ERROR);
glActiveTexture(GL_TEXTURE0);
}
assert(glGetError() == GL_NO_ERROR);
glActiveTexture(GL_TEXTURE0);
}
@@
-139,6
+140,7
@@
TextureType Texture::get_type() const
void Texture::bind(int tex_unit) const
{
glActiveTexture(GL_TEXTURE0 + tex_unit);
void Texture::bind(int tex_unit) const
{
glActiveTexture(GL_TEXTURE0 + tex_unit);
+ glEnable(target);
glBindTexture(target, id);
assert(glGetError() == GL_NO_ERROR);
glActiveTexture(GL_TEXTURE0);
glBindTexture(target, id);
assert(glGetError() == GL_NO_ERROR);
glActiveTexture(GL_TEXTURE0);