FIFE  2008.0
 All Classes Namespaces Functions Variables Enumerations Enumerator Pages
enginesettings.h
1 /***************************************************************************
2  * Copyright (C) 2005-2010 by the FIFE team *
3  * http://www.fifengine.net *
4  * This file is part of FIFE. *
5  * *
6  * FIFE is free software; you can redistribute it and/or *
7  * modify it under the terms of the GNU Lesser General Public *
8  * License as published by the Free Software Foundation; either *
9  * version 2.1 of the License, or (at your option) any later version. *
10  * *
11  * This library is distributed in the hope that it will be useful, *
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
14  * Lesser General Public License for more details. *
15  * *
16  * You should have received a copy of the GNU Lesser General Public *
17  * License along with this library; if not, write to the *
18  * Free Software Foundation, Inc., *
19  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
20  ***************************************************************************/
21 
22 #ifndef FIFE_ENGINESETTINGS_H
23 #define FIFE_ENGINESETTINGS_H
24 
25 // Standard C++ library includes
26 #include <vector>
27 
28 // 3rd party library includes
29 
30 // FIFE includes
31 // These includes are split up in two parts, separated by one empty line
32 // First block: files included from the FIFE root src directory
33 // Second block: files included from the same folder
34 #include "util/base/exception.h"
35 
36 namespace FIFE {
37  class NotSupported;
38 
43  public:
47 
51 
54  void validate() const;
55 
59  void setBitsPerPixel(uint16_t bitsperpixel);
60 
63  uint16_t getBitsPerPixel() const {
64  return m_bitsperpixel;
65  }
66 
69  std::vector<uint16_t> getPossibleBitsPerPixel() const;
70 
73  std::vector<std::pair<uint16_t, uint16_t> > getPossibleResolutions() const;
74 
77  void setFullScreen(bool fullscreen) {
78  m_fullscreen = fullscreen;
79  }
80 
83  bool isFullScreen() const {
84  return m_fullscreen;
85  }
86 
90  void setInitialVolume(float volume);
91 
94  float getInitialVolume() const {
95  return m_initialvolume;
96  }
97 
100  float getMaxVolume() const;
101 
105  void setRenderBackend(const std::string& renderbackend);
106 
109  const std::string getRenderBackend() const {
110  return m_renderbackend;
111  }
112 
115  std::vector<std::string> getPossibleRenderBackends();
116 
119  void setSDLRemoveFakeAlpha(bool sdlremovefakealpha);
120 
123  bool isSDLRemoveFakeAlpha(bool sdlremovefakealpha) const {
124  return m_sdlremovefakealpha;
125  }
126 
129  void setScreenWidth(uint16_t screenwidth);
130 
133  uint16_t getScreenWidth() const {
134  return m_screenwidth;
135  }
136 
139  void setScreenHeight(uint16_t screenheight);
140 
143  uint16_t getScreenHeight() const {
144  return m_screenheight;
145  }
146 
149  void setDefaultFontPath(const std::string& defaultfontpath);
150 
153  std::string getDefaultFontPath() const {
154  return m_defaultfontpath;
155  }
156 
159  void setDefaultFontSize(uint16_t defaultfontsize);
160 
163  uint16_t getDefaultFontSize() const {
164  return m_defaultfontsize;
165  }
166 
169  void setDefaultFontGlyphs(const std::string& defaultfontglyphs);
170 
173  std::string getDefaultFontGlyphs() const {
174  return m_defaultfontglyphs;
175  }
176 
179  void setWindowTitle(const std::string& title);
180 
183  std::string getWindowTitle() const {
184  return m_windowtitle;
185  }
186 
189  void setWindowIcon(const std::string& icon);
190 
193  std::string getWindowIcon() const {
194  return m_windowicon;
195  }
196 
199  void setColorKeyEnabled(bool colorkeyenable);
200 
203  bool isColorKeyEnabled() const;
204 
207  void setColorKey(uint8_t r, uint8_t g, uint8_t b);
208 
211  const SDL_Color& getColorKey() const;
212 
213  void setVideoDriver(const std::string& driver);
214 
215  const std::string& getVideoDriver() const;
216 
219  void setLightingModel(unsigned int lighting);
220 
223  unsigned int getLightingModel() const {
224  return m_lighting;
225  }
226 
227  private:
228  uint8_t m_bitsperpixel;
229  bool m_fullscreen;
230  float m_initialvolume;
231  std::string m_renderbackend;
232  bool m_sdlremovefakealpha;
233  uint16_t m_screenwidth;
234  uint16_t m_screenheight;
235  std::string m_windowtitle;
236  std::string m_windowicon;
237 
238 
239  std::string m_defaultfontpath;
240  uint16_t m_defaultfontsize;
241  std::string m_defaultfontglyphs;
242  bool m_iscolorkeyenabled;
243  SDL_Color m_colorkey;
244  std::string m_videodriver;
245  unsigned int m_lighting;
246  };
247 
248 }//FIFE
249 
250 #endif
251