summaryrefslogtreecommitdiff
path: root/mogltk
diff options
context:
space:
mode:
Diffstat (limited to 'mogltk')
-rw-r--r--mogltk/glbase.cpp1
-rw-r--r--mogltk/gltexture.cpp5
2 files changed, 5 insertions, 1 deletions
diff --git a/mogltk/glbase.cpp b/mogltk/glbase.cpp
index 11d15ae..5e63e86 100644
--- a/mogltk/glbase.cpp
+++ b/mogltk/glbase.cpp
@@ -59,7 +59,6 @@ int mogltk::glbase::setup(int w, int h, int flags) throw(GeneralException) {
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
- glEnable(GL_TEXTURE_2D);
glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_DECAL);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
diff --git a/mogltk/gltexture.cpp b/mogltk/gltexture.cpp
index 0549ee3..7949cb9 100644
--- a/mogltk/gltexture.cpp
+++ b/mogltk/gltexture.cpp
@@ -62,6 +62,7 @@ void mogltk::texture::Generate() throw (GeneralException) {
void mogltk::texture::Bind(bool expand) throw (GeneralException) {
if (surface)
throw GeneralException("Texture is not yet generated");
+ glEnable(GL_TEXTURE_2D);
glBindTexture(GL_TEXTURE_2D, tex);
if (expand) {
glMatrixMode(GL_TEXTURE);
@@ -78,3 +79,7 @@ GLuint mogltk::texture::GetWidth() {
GLuint mogltk::texture::GetHeight() {
return height;
}
+
+void mogltk::texture::Unbind(void) {
+ glDisable(GL_TEXTURE_2D);
+}