From bf452e7f6a3fa0e41964fc8e2c57e1e577cd1682 Mon Sep 17 00:00:00 2001 From: pixel Date: Sun, 20 Jun 2004 23:51:59 +0000 Subject: Put some modifications in the overall. Font to texture doesn't work though. --- lib/base.cc | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'lib/base.cc') 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); +} -- cgit v1.2.3