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

sdlmm_display.h

Go to the documentation of this file.
00001 /*
00002  * SDmm - a C++ wrapper for SDL and related libraries
00003  * Copyright © 2001 David Hedbor <david@hedbor.org>
00004  * 
00005  * This program is free software; you can redistribute it and/or
00006  * modify it under the terms of the GNU General Public License as
00007  * published by the Free Software Foundation; either version 2 of the
00008  * License, or (at your option) any later version.
00009  * 
00010  * This program is distributed in the hope that it will be useful, but
00011  * WITHOUT ANY WARRANTY; without even the implied warranty of
00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013  * General Public License for more details.
00014  * 
00015  * You should have received a copy of the GNU General Public License
00016  * along with this program; if not, write to the Free Software
00017  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00018  *
00019  */
00020 
00021 
00022 #ifndef SDLMM_DISPLAY_H
00023 #define SDLMM_DISPLAY_H
00024 
00025 #include "sdlmm_basesurface.h"
00026 
00027 namespace SDLmm {
00029 
00039   class DECLSPEC Display : public BaseSurface {
00040   protected:
00042     Display& operator= (Display&);
00043     Display(Display&);
00044     
00045     Display() : BaseSurface(NULL)  {  } 
00046 
00047   public:    
00048     ~Display() {
00049       me = 0; // Or it will be destroyed by the BaseSurface destructor...
00050     } 
00051 
00053     static Display& GetDisplay();
00054 
00056 
00057 
00058 
00069     void UpdateRect(Sint32 x = 0, Sint32 y = 0, Sint32 w = 0, Sint32 h = 0);
00070 
00072 
00079     void Update() { UpdateRect(); }
00080 
00082 
00088     void UpdateRect(SDL_Rect& rect);
00089 
00091 
00108     void UpdateRects(int numrects, SDL_Rect *rects);
00109 
00111 
00125     bool Flip() { return SDL_Flip(me) == 0; }
00127    
00130 
00139     bool SetVideoMode(int w, int h, int bpp = 0, Uint32 flags = 0);
00140 
00142 
00143 
00144 
00147     static bool Init();
00148 
00150     static void Quit();
00151     
00153 
00170     static int VideoModeOK(int w, int h, int bpp, Uint32 flags);
00171 
00174 
00191     static SDL_Rect **ListModes(SDL_PixelFormat *format = 0, Uint32 flags = 0);
00193 
00194 
00196 
00197 
00198 
00202     void SetCaption(const char *title, const char *icon);
00203 
00205 
00209     void SetCaption(const std::string& title, const std::string& icon);
00211 
00215     void GetCaption(char **title, char **icon);
00216 
00218 
00222     void GetCaption(std::string &title, std::string &icon);
00223 
00225 
00234     void SetIcon(BaseSurface& icon, Uint8 *mask = 0);
00235       
00237 
00249     bool Iconify();
00250 
00252 
00259     bool ToggleFullScreen();
00260 
00262 
00280     SDL_GrabMode GrabInput(SDL_GrabMode mode);
00282 
00283     // Documented in BaseSurface. Just return true since the display is always
00284     // in the display format. Naturally. :-)
00285     bool SetDisplayFormat() { return true; }
00286     bool SetDisplayFormatAlpha() { return true; }    
00287   };
00288 }
00289 
00290 #endif // SDLMM_DISPLAY_H
00291 

Documentation automatically generated by doxygen written by Dimitri van Heesch. Project hosted at
Hosted by SourceForge