summaryrefslogtreecommitdiff
path: root/lib/glbase.cc
diff options
context:
space:
mode:
Diffstat (limited to 'lib/glbase.cc')
-rw-r--r--lib/glbase.cc9
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/glbase.cc b/lib/glbase.cc
index 67b1b9c..3cdea12 100644
--- a/lib/glbase.cc
+++ b/lib/glbase.cc
@@ -25,7 +25,8 @@ int mogltk::glbase::setup(int w, int h, int flags) throw(GeneralException) {
throw GeneralException(String("Couldn't initialise Video SubSystem: ") + SDL_GetError());
}
- if (!(surface = SDL_SetVideoMode(width, height, 0, flags | SDL_OPENGL))) {
+ if (!(surface = SDL_SetVideoMode(width, height, 0, flags | SDL_OPENGL | SDL_FULLSCREEN))) {
+// if (!(surface = SDL_SetVideoMode(1024, 768, 0, flags | SDL_OPENGL))) {
throw GeneralException(String("Couldn't set GL mode: ") + SDL_GetError());
}
@@ -68,7 +69,8 @@ int mogltk::glbase::setup(int w, int h, int flags) throw(GeneralException) {
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
SDL_ShowCursor(0);
- Flip();
+ SDL_GL_SwapBuffers();
+ glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
return 0;
}
@@ -122,9 +124,10 @@ void mogltk::glbase::Leave2DMode(void) {
}
void mogltk::glbase::Flip() {
+ printm(M_INFO, "Flipping\n");
+ mogltk::engine::pollevents();
SDL_GL_SwapBuffers();
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
- mogltk::engine::pollevents();
}
bool mogltk::glbase::is2D() {