summaryrefslogtreecommitdiff
path: root/mogltk/glbase.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'mogltk/glbase.cpp')
-rw-r--r--mogltk/glbase.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/mogltk/glbase.cpp b/mogltk/glbase.cpp
index dabf28a..11d15ae 100644
--- a/mogltk/glbase.cpp
+++ b/mogltk/glbase.cpp
@@ -62,6 +62,9 @@ int mogltk::glbase::setup(int w, int h, int flags) throw(GeneralException) {
glEnable(GL_TEXTURE_2D);
glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_DECAL);
+ glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
+ Flip();
+
return 0;
}
@@ -115,6 +118,7 @@ void mogltk::glbase::Leave2DMode(void) {
void mogltk::glbase::Flip() {
SDL_GL_SwapBuffers();
+ glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
}
bool mogltk::glbase::is2D() {