src/graphic/video.h

Go to the documentation of this file.
00001 /******************************************************************************
00002  *  Wormux is a convivial mass murder game.
00003  *  Copyright (C) 2001-2004 Lawrence Azzoug.
00004  *
00005  *  This program is free software; you can redistribute it and/or modify
00006  *  it under the terms of the GNU General Public License as published by
00007  *  the Free Software Foundation; either version 2 of the License, or
00008  *  (at your option) any later version.
00009  *
00010  *  This program is distributed in the hope that it will be useful,
00011  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013  *  GNU 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
00018  *****************************************************************************/
00019 
00020 #ifndef VIDEO_H
00021 #define VIDEO_H
00022 
00023 #include <SDL.h>
00024 #include <string>
00025 #include <list>
00026 #include "surface.h"
00027 #include "../include/base.h"
00028 
00029 class Video{
00030  private:
00031   uint m_max_fps;     // If equals to zero, it means no limit
00032   uint m_sleep_max_fps;
00033   bool SDLReady;
00034   bool fullscreen;
00035 
00036   std::list<Point2i> available_configs;
00037   void ComputeAvailableConfigs();
00038 
00039   void SetWindowIcon(std::string icon);
00040   void InitSDL(void);
00041 
00042 public:
00043   Surface window;
00044   void SetWindowCaption(std::string caption);
00045   void SetMaxFps(uint max_fps);
00046   uint GetMaxFps();
00047   uint GetSleepMaxFps();
00048 
00049 public:
00050   Video();
00051   ~Video();
00052 
00053   bool IsFullScreen() const;
00054 
00055   std::list<Point2i>& GetAvailableConfigs();
00056   bool SetConfig(int width, int height, bool fullscreen);
00057   void ToggleFullscreen();
00058 
00059   void InitWindow(void);
00060 
00061   void Flip(void);
00062 }; 
00063 
00064 #endif

Generated on Mon Jan 1 13:10:56 2007 for Wormux by  doxygen 1.4.7