enginesettings.h

00001 /***************************************************************************
00002  *   Copyright (C) 2005-2010 by the FIFE team                              *
00003  *   http://www.fifengine.net                                              *
00004  *   This file is part of FIFE.                                            *
00005  *                                                                         *
00006  *   FIFE 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.,                                       *
00019  *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA          *
00020  ***************************************************************************/
00021 
00022 #ifndef FIFE_ENGINESETTINGS_H
00023 #define FIFE_ENGINESETTINGS_H
00024 
00025 // Standard C++ library includes
00026 #include <vector>
00027 
00028 // 3rd party library includes
00029 
00030 // FIFE includes
00031 // These includes are split up in two parts, separated by one empty line
00032 // First block: files included from the FIFE root src directory
00033 // Second block: files included from the same folder
00034 #include "util/base/exception.h"
00035 
00036 namespace FIFE {
00037     class NotSupported;
00038 
00042     class EngineSettings {
00043     public:
00046         EngineSettings();
00047 
00050         ~EngineSettings();
00051 
00054         void validate() const;
00055 
00059         void setBitsPerPixel(uint16_t bitsperpixel);
00060 
00063         uint16_t getBitsPerPixel() const {
00064             return m_bitsperpixel;
00065         }
00066 
00069         std::vector<uint16_t> getPossibleBitsPerPixel() const;
00070 
00073         std::vector<std::pair<uint16_t, uint16_t> > getPossibleResolutions() const;
00074 
00077         void setFullScreen(bool fullscreen) {
00078             m_fullscreen = fullscreen;
00079         }
00080 
00083         bool isFullScreen() const {
00084             return m_fullscreen;
00085         }
00086 
00090         void setInitialVolume(float volume);
00091 
00094         float getInitialVolume() const {
00095             return m_initialvolume;
00096         }
00097 
00100         float getMaxVolume() const;
00101 
00105         void setRenderBackend(const std::string& renderbackend);
00106 
00109         const std::string getRenderBackend() const {
00110             return m_renderbackend;
00111         }
00112 
00115         std::vector<std::string> getPossibleRenderBackends();
00116 
00119         void setSDLRemoveFakeAlpha(bool sdlremovefakealpha);
00120 
00123         bool isSDLRemoveFakeAlpha(bool sdlremovefakealpha) const {
00124             return m_sdlremovefakealpha;
00125         }
00126 
00129         void setScreenWidth(uint16_t screenwidth);
00130 
00133         uint16_t getScreenWidth() const {
00134             return m_screenwidth;
00135         }
00136 
00139         void setScreenHeight(uint16_t screenheight);
00140 
00143         uint16_t getScreenHeight() const {
00144             return m_screenheight;
00145         }
00146 
00149         void setDefaultFontPath(const std::string& defaultfontpath);
00150 
00153         std::string getDefaultFontPath() const {
00154             return m_defaultfontpath;
00155         }
00156 
00159         void setDefaultFontSize(uint16_t defaultfontsize);
00160 
00163         uint16_t getDefaultFontSize() const {
00164             return m_defaultfontsize;
00165         }
00166 
00169         void setDefaultFontGlyphs(const std::string& defaultfontglyphs);
00170 
00173         std::string getDefaultFontGlyphs() const {
00174             return m_defaultfontglyphs;
00175         }
00176 
00179         void setWindowTitle(const std::string& title);
00180 
00183         std::string getWindowTitle() const {
00184             return m_windowtitle;
00185         }
00186 
00189         void setWindowIcon(const std::string& icon);
00190 
00193         std::string getWindowIcon() const {
00194             return m_windowicon;
00195         }
00196 
00199         void setColorKeyEnabled(bool colorkeyenable);
00200 
00203         bool isColorKeyEnabled() const;
00204 
00207         void setColorKey(uint8_t r, uint8_t g, uint8_t b);
00208 
00211         const SDL_Color& getColorKey() const;
00212 
00213         void setVideoDriver(const std::string& driver);
00214 
00215         const std::string& getVideoDriver() const;
00216 
00219         void setLightingModel(unsigned int lighting);
00220 
00223         unsigned int getLightingModel() const {
00224             return m_lighting;
00225         }
00226 
00227     private:
00228         uint8_t m_bitsperpixel;
00229         bool m_fullscreen;
00230         float m_initialvolume;
00231         std::string m_renderbackend;
00232         bool m_sdlremovefakealpha;
00233         uint16_t m_screenwidth;
00234         uint16_t m_screenheight;
00235         std::string m_windowtitle;
00236         std::string m_windowicon;       
00237 
00238 
00239         std::string m_defaultfontpath;
00240         uint16_t m_defaultfontsize;
00241         std::string m_defaultfontglyphs;
00242         bool m_iscolorkeyenabled;
00243         SDL_Color m_colorkey;
00244         std::string m_videodriver;
00245         unsigned int m_lighting;
00246     };
00247 
00248 }//FIFE
00249 
00250 #endif
00251 
Generated on Wed Nov 23 13:04:42 2011 for FIFE by  doxygen 1.6.3