From 2f0a5668ea937d1441399f2014bf9572902a9fb4 Mon Sep 17 00:00:00 2001 From: Bjørn Lindeijer Date: Tue, 25 Jan 2005 19:51:04 +0000 Subject: Fixed unable to click away sound error dialogs. --- src/main.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/main.cpp b/src/main.cpp index 6f9eeeb0..5a4eac7d 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -195,6 +195,7 @@ void init_engine() { if ((int)config.getValue("screen", 0)) { displayFlags |= SDL_FULLSCREEN; } +#ifndef USE_OPENGL if ((int)config.getValue("hwaccel", 0)) { std::cout << "Attempting to use hardware acceleration.\n"; displayFlags |= SDL_HWSURFACE | SDL_DOUBLEBUF; @@ -202,6 +203,10 @@ void init_engine() { else { displayFlags |= SDL_SWSURFACE; } +#else + displayFlags |= SDL_OPENGL; + SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1); +#endif screen = SDL_SetVideoMode(800, 600, 32, displayFlags); if (screen == NULL) { @@ -210,6 +215,12 @@ void init_engine() { exit(1); } +#ifdef USE_OPENGL + // Setup OpenGL + glViewport(0, 0, 800, 600); + glClearColor(0.0f, 0.0f, 0.0f, 0.0f); +#endif + #ifdef __DEBUG const SDL_VideoInfo *vi = SDL_GetVideoInfo(); std::cout << "It is " << ((vi->hw_available) ? "" : "not") << @@ -301,6 +312,8 @@ int main(int argc, char *argv[]) { state = EXIT; break; } + + guiInput->pushInput(event); } switch (state) { -- cgit v1.2.3-70-g09d2