diff options
author | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2005-01-17 23:57:16 +0000 |
---|---|---|
committer | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2005-01-17 23:57:16 +0000 |
commit | 39ea054b214612ae7d56a01884904dcb63181598 (patch) | |
tree | 975b05806f0e939d3f2369b46676009f89e692c8 /src/main.cpp | |
parent | 40e8a99139fa494f837670737c25755817b961a4 (diff) | |
download | mana-39ea054b214612ae7d56a01884904dcb63181598.tar.gz mana-39ea054b214612ae7d56a01884904dcb63181598.tar.bz2 mana-39ea054b214612ae7d56a01884904dcb63181598.tar.xz mana-39ea054b214612ae7d56a01884904dcb63181598.zip |
Added support for hwaccel option.
Diffstat (limited to 'src/main.cpp')
-rw-r--r-- | src/main.cpp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/main.cpp b/src/main.cpp index df5cbeec..758e18f3 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -197,11 +197,18 @@ void init_engine() { SDL_WM_SetCaption("The Mana World", NULL); - int displayFlags = SDL_SWSURFACE | SDL_ANYFORMAT; + int displayFlags = SDL_ANYFORMAT; if ((int)config.getValue("screen", 0)) { displayFlags |= SDL_FULLSCREEN; } + if ((int)config.getValue("hwaccel", 0)) { + std::cout << "Attempting to use hardware acceleration.\n"; + displayFlags |= SDL_HWSURFACE | SDL_DOUBLEBUF; + } + else { + displayFlags |= SDL_SWSURFACE; + } screen = SDL_SetVideoMode(800, 600, 16, displayFlags); if (screen == NULL) { @@ -210,10 +217,6 @@ void init_engine() { exit(1); } - //if (set_gfx_mode((unsigned char)config.getValue("screen", 0), 800, 600, - // 0, 0)) { - //} - // Create the graphics context graphics = new Graphics(); |