Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | Related Pages

screensurface.h

00001 /* 00002 libwftk - Worldforge Toolkit - a widget library 00003 Copyright (C) 2002 Malcolm Walker <malcolm@worldforge.org> 00004 Based on code copyright (C) 1999-2002 Karsten Laux 00005 00006 This library is free software; you can redistribute it and/or 00007 modify it under the terms of the GNU Lesser General Public 00008 License as published by the Free Software Foundation; either 00009 version 2.1 of the License, or (at your option) any later version. 00010 00011 This library is distributed in the hope that it will be useful, 00012 but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00014 Lesser General Public License for more details. 00015 00016 You should have received a copy of the GNU Lesser General Public 00017 License along with this library; if not, write to the 00018 Free Software Foundation, Inc., 59 Temple Place - Suite 330, 00019 Boston, MA 02111-1307, SA. 00020 */ 00021 // written by Karsten Laux, June 1999 00022 00023 #ifndef _SCREENSURFACE_H_ 00024 #define _SCREENSURFACE_H_ 00025 00026 #include <sigc++/object.h> 00027 #if SIGC_MAJOR_VERSION == 1 && SIGC_MINOR_VERSION == 0 00028 #include <sigc++/signal_system.h> 00029 #else 00030 #include <sigc++/signal.h> 00031 #endif 00032 00033 #include <wftk/surface.h> 00034 #include <wftk/mutex.h> 00035 00036 namespace wftk { 00037 00038 class Region; 00039 00041 class ScreenSurface : public Surface 00042 { 00043 public: 00045 ScreenSurface(int w, int h, int bitsPerPixel, bool fullscreen, bool resizeable, Uint32 extra_flags); 00047 ~ScreenSurface() {sdlSurface_ = 0;} // keep Surface from calling SDL_FreeSurface() 00048 00050 void update(); 00052 void update(const Rect& dest); 00054 void update(const Region& dest); 00056 void flip(); 00058 bool doublebuffered() const {return (sdlSurface_->flags & SDL_DOUBLEBUF) != 0;} 00060 bool fullscreen() const {return (sdlSurface_->flags & SDL_FULLSCREEN) != 0;} 00062 bool resizeable() const {return (sdlSurface_->flags & SDL_RESIZABLE) != 0;} 00064 static bool setGamma(float red, float green, float blue); 00066 static bool setGammaRamp(Uint16 *red, Uint16 *green, Uint16 *blue); 00068 Uint32 flags_; 00069 00071 00076 Mutex mutex; 00077 00079 void resize(unsigned w, unsigned h); 00080 00087 SigC::Signal2<void,int,int> Resized; 00088 00089 private: 00090 ScreenSurface(const ScreenSurface&); 00091 ScreenSurface& operator=(const ScreenSurface&); 00092 }; 00093 00094 } 00095 00096 #endif 00097 00098 00099

Generated Wed Jul 28 17:28:43 2004.
Copyright © 1998-2003 by the respective authors.

This document is licensed under the terms of the GNU Free Documentation License and may be freely distributed under the conditions given by this license.