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 
00055         void setBitsPerPixel(uint8_t bitsperpixel);
00056 
00059         uint8_t getBitsPerPixel() const {
00060             return m_bitsperpixel;
00061         }
00062 
00065         std::vector<uint8_t> getPossibleBitsPerPixel() const;
00066 
00069         void setFullScreen(bool fullscreen) {
00070             m_fullscreen = fullscreen;
00071         }
00072 
00075         bool isFullScreen() const {
00076             return m_fullscreen;
00077         }
00078 
00082         void setInitialVolume(float volume);
00083 
00086         float getInitialVolume() const {
00087             return m_initialvolume;
00088         }
00089 
00092         float getMaxVolume() const;
00093 
00097         void setRenderBackend(const std::string& renderbackend);
00098 
00101         const std::string& getRenderBackend() const {
00102             return m_renderbackend;
00103         }
00104 
00107         std::string getRenderBackend() {
00108             return m_renderbackend;
00109         }
00110 
00113         std::vector<std::string> getPossibleRenderBackends();
00114 
00117         void setSDLRemoveFakeAlpha(bool sdlremovefakealpha);
00118 
00121         bool isSDLRemoveFakeAlpha() const {
00122             return m_sdlremovefakealpha;
00123         }
00124 
00127         void setGLCompressImages(bool oglcompressimages);
00128 
00131         bool isGLCompressImages() const {
00132             return m_oglcompressimages;
00133         }
00134 
00137         void setGLUseFramebuffer(bool ogluseframebuffer);
00138 
00141         bool isGLUseFramebuffer() const {
00142             return m_ogluseframebuffer;
00143         }
00144 
00147         void setGLUseNPOT(bool oglusenpot);
00148 
00151         bool isGLUseNPOT() const {
00152             return m_oglusenpot;
00153         }
00154 
00157         void setScreenWidth(uint16_t screenwidth);
00158 
00161         uint16_t getScreenWidth() const {
00162             return m_screenwidth;
00163         }
00164 
00167         void setScreenHeight(uint16_t screenheight);
00168 
00171         uint16_t getScreenHeight() const {
00172             return m_screenheight;
00173         }
00174 
00177         void setDefaultFontPath(const std::string& defaultfontpath);
00178 
00181         const std::string& getDefaultFontPath() const {
00182             return m_defaultfontpath;
00183         }
00184 
00187         std::string getDefaultFontPath() {
00188             return m_defaultfontpath;
00189         }
00190 
00193         void setDefaultFontSize(uint16_t defaultfontsize);
00194 
00197         uint16_t getDefaultFontSize() const {
00198             return m_defaultfontsize;
00199         }
00200 
00203         void setDefaultFontGlyphs(const std::string& defaultfontglyphs);
00204 
00207         const std::string& getDefaultFontGlyphs() const {
00208             return m_defaultfontglyphs;
00209         }
00210 
00213         std::string getDefaultFontGlyphs() {
00214             return m_defaultfontglyphs;
00215         }
00216 
00219         void setWindowTitle(const std::string& title);
00220 
00223         const std::string& getWindowTitle() const {
00224             return m_windowtitle;
00225         }
00226 
00229         std::string getWindowTitle() {
00230             return m_windowtitle;
00231         }
00232 
00235         void setWindowIcon(const std::string& icon);
00236 
00239         const std::string& getWindowIcon() const {
00240             return m_windowicon;
00241         }
00242 
00245         std::string getWindowIcon() {
00246             return m_windowicon;
00247         }
00248 
00251         void setColorKeyEnabled(bool colorkeyenable);
00252 
00255         bool isColorKeyEnabled() const;
00256 
00259         void setColorKey(uint8_t r, uint8_t g, uint8_t b);
00260 
00263         const SDL_Color& getColorKey() const;
00264 
00265         void setVideoDriver(const std::string& driver);
00266 
00267         const std::string& getVideoDriver() const;
00268 
00271         void setLightingModel(uint32_t lighting);
00272 
00275         uint32_t getLightingModel() const {
00276             return m_lighting;
00277         }
00278 
00281         void setFrameLimitEnabled(bool limited);
00282         
00285         bool isFrameLimitEnabled() const;
00286 
00289         void setFrameLimit(uint16_t framelimit);
00290 
00293         uint16_t getFrameLimit() const;
00294 
00297         void setMouseSensitivity(float sens);
00298 
00301         float getMouseSensitivity() const;
00302 
00307         void setMouseAcceleration(bool acceleration);
00308 
00311         bool getMouseAcceleration() const;
00312 
00313     private:
00314         uint8_t m_bitsperpixel;
00315         bool m_fullscreen;
00316         float m_initialvolume;
00317         std::string m_renderbackend;
00318         bool m_sdlremovefakealpha;
00319         bool m_oglcompressimages;
00320         bool m_ogluseframebuffer;
00321         bool m_oglusenpot;
00322         uint16_t m_screenwidth;
00323         uint16_t m_screenheight;
00324         std::string m_windowtitle;
00325         std::string m_windowicon;
00326 
00327 
00328         std::string m_defaultfontpath;
00329         uint16_t m_defaultfontsize;
00330         std::string m_defaultfontglyphs;
00331         bool m_iscolorkeyenabled;
00332         SDL_Color m_colorkey;
00333         std::string m_videodriver;
00334         uint32_t m_lighting;
00335         bool m_isframelimit;
00336         uint16_t m_framelimit;
00337         float m_mousesensitivity;
00338         bool m_mouseacceleration;
00339     };
00340 
00341 }//FIFE
00342 
00343 #endif
00344