diff options
author | pixel <pixel> | 2004-06-20 23:51:59 +0000 |
---|---|---|
committer | pixel <pixel> | 2004-06-20 23:51:59 +0000 |
commit | bf452e7f6a3fa0e41964fc8e2c57e1e577cd1682 (patch) | |
tree | da2c9b920514d4f7b853cf92ee4050720261dde6 /lib/base.cc | |
parent | b009a6451b7560ba1e0064303deede287c381963 (diff) |
Put some modifications in the overall. Font to texture doesn't work though.
Diffstat (limited to 'lib/base.cc')
-rw-r--r-- | lib/base.cc | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/lib/base.cc b/lib/base.cc index 7a6c854..acfc654 100644 --- a/lib/base.cc +++ b/lib/base.cc @@ -17,7 +17,7 @@ mogltk::base::base(int w, int h, int flags) throw(GeneralException) : surface(0) throw GeneralException(String("Couldn't initialise Video SubSystem: ") + SDL_GetError()); } - if (!(surface = SDL_SetVideoMode(width, height, 0, flags))) { + if (!(surface = SDL_SetVideoMode(width, height, 0, flags | SDL_HWSURFACE))) { throw GeneralException(String("Couldn't set SDL mode: ") + SDL_GetError()); } @@ -94,3 +94,17 @@ void mogltk::base::changeviewport(int x, int y, unsigned int w, unsigned int h) SDL_SetClipRect(surface, &r); } + +void mogltk::base::ToggleFullscreen() { + int newflags = surface->flags; + + if (surface->flags & SDL_FULLSCREEN) + newflags &= ~SDL_FULLSCREEN; + else + newflags |= SDL_FULLSCREEN; + + texture::Taintall(); + + surface = SDL_SetVideoMode(surface->w, surface->h, surface->format->BitsPerPixel, + SDL_HWSURFACE | newflags); +} |