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 
55  void setBitsPerPixel(uint8_t bitsperpixel);
56 
59  uint8_t getBitsPerPixel() const {
60  return m_bitsperpixel;
61  }
62 
65  std::vector<uint8_t> getPossibleBitsPerPixel() const;
66 
69  void setFullScreen(bool fullscreen) {
70  m_fullscreen = fullscreen;
71  }
72 
75  bool isFullScreen() const {
76  return m_fullscreen;
77  }
78 
82  void setInitialVolume(float volume);
83 
86  float getInitialVolume() const {
87  return m_initialvolume;
88  }
89 
92  float getMaxVolume() const;
93 
97  void setRenderBackend(const std::string& renderbackend);
98 
101  const std::string& getRenderBackend() const {
102  return m_renderbackend;
103  }
104 
107  std::string getRenderBackend() {
108  return m_renderbackend;
109  }
110 
113  std::vector<std::string> getPossibleRenderBackends();
114 
117  void setSDLRemoveFakeAlpha(bool sdlremovefakealpha);
118 
121  bool isSDLRemoveFakeAlpha() const {
122  return m_sdlremovefakealpha;
123  }
124 
127  void setGLCompressImages(bool oglcompressimages);
128 
131  bool isGLCompressImages() const {
132  return m_oglcompressimages;
133  }
134 
137  void setGLUseFramebuffer(bool ogluseframebuffer);
138 
141  bool isGLUseFramebuffer() const {
142  return m_ogluseframebuffer;
143  }
144 
147  void setGLUseNPOT(bool oglusenpot);
148 
151  bool isGLUseNPOT() const {
152  return m_oglusenpot;
153  }
154 
157  void setScreenWidth(uint16_t screenwidth);
158 
161  uint16_t getScreenWidth() const {
162  return m_screenwidth;
163  }
164 
167  void setScreenHeight(uint16_t screenheight);
168 
171  uint16_t getScreenHeight() const {
172  return m_screenheight;
173  }
174 
177  void setDefaultFontPath(const std::string& defaultfontpath);
178 
181  const std::string& getDefaultFontPath() const {
182  return m_defaultfontpath;
183  }
184 
187  std::string getDefaultFontPath() {
188  return m_defaultfontpath;
189  }
190 
193  void setDefaultFontSize(uint16_t defaultfontsize);
194 
197  uint16_t getDefaultFontSize() const {
198  return m_defaultfontsize;
199  }
200 
203  void setDefaultFontGlyphs(const std::string& defaultfontglyphs);
204 
207  const std::string& getDefaultFontGlyphs() const {
208  return m_defaultfontglyphs;
209  }
210 
213  std::string getDefaultFontGlyphs() {
214  return m_defaultfontglyphs;
215  }
216 
219  void setWindowTitle(const std::string& title);
220 
223  const std::string& getWindowTitle() const {
224  return m_windowtitle;
225  }
226 
229  std::string getWindowTitle() {
230  return m_windowtitle;
231  }
232 
235  void setWindowIcon(const std::string& icon);
236 
239  const std::string& getWindowIcon() const {
240  return m_windowicon;
241  }
242 
245  std::string getWindowIcon() {
246  return m_windowicon;
247  }
248 
251  void setColorKeyEnabled(bool colorkeyenable);
252 
255  bool isColorKeyEnabled() const;
256 
259  void setColorKey(uint8_t r, uint8_t g, uint8_t b);
260 
263  const SDL_Color& getColorKey() const;
264 
265  void setVideoDriver(const std::string& driver);
266 
267  const std::string& getVideoDriver() const;
268 
271  void setLightingModel(uint32_t lighting);
272 
275  uint32_t getLightingModel() const {
276  return m_lighting;
277  }
278 
281  void setFrameLimitEnabled(bool limited);
282 
285  bool isFrameLimitEnabled() const;
286 
289  void setFrameLimit(uint16_t framelimit);
290 
293  uint16_t getFrameLimit() const;
294 
297  void setMouseSensitivity(float sens);
298 
301  float getMouseSensitivity() const;
302 
307  void setMouseAcceleration(bool acceleration);
308 
311  bool getMouseAcceleration() const;
312 
313  private:
314  uint8_t m_bitsperpixel;
315  bool m_fullscreen;
316  float m_initialvolume;
317  std::string m_renderbackend;
318  bool m_sdlremovefakealpha;
319  bool m_oglcompressimages;
320  bool m_ogluseframebuffer;
321  bool m_oglusenpot;
322  uint16_t m_screenwidth;
323  uint16_t m_screenheight;
324  std::string m_windowtitle;
325  std::string m_windowicon;
326 
327 
328  std::string m_defaultfontpath;
329  uint16_t m_defaultfontsize;
330  std::string m_defaultfontglyphs;
331  bool m_iscolorkeyenabled;
332  SDL_Color m_colorkey;
333  std::string m_videodriver;
334  uint32_t m_lighting;
335  bool m_isframelimit;
336  uint16_t m_framelimit;
337  float m_mousesensitivity;
338  bool m_mouseacceleration;
339  };
340 
341 }//FIFE
342 
343 #endif
344 
std::string getDefaultFontGlyphs()
void setDefaultFontSize(uint16_t defaultfontsize)
bool getMouseAcceleration() const
float getMaxVolume() const
std::string getDefaultFontPath()
bool isColorKeyEnabled() const
void setMouseAcceleration(bool acceleration)
void setGLUseFramebuffer(bool ogluseframebuffer)
void setFrameLimitEnabled(bool limited)
void setInitialVolume(float volume)
void setSDLRemoveFakeAlpha(bool sdlremovefakealpha)
void setDefaultFontGlyphs(const std::string &defaultfontglyphs)
void setMouseSensitivity(float sens)
bool isFrameLimitEnabled() const
std::string getWindowIcon()
void setFullScreen(bool fullscreen)
uint16_t getDefaultFontSize() const
uint16_t getScreenHeight() const
void setColorKeyEnabled(bool colorkeyenable)
const SDL_Color & getColorKey() const
const std::string & getWindowTitle() const
bool isGLUseNPOT() const
void setGLCompressImages(bool oglcompressimages)
uint16_t getScreenWidth() const
void setWindowTitle(const std::string &title)
float getMouseSensitivity() const
void setDefaultFontPath(const std::string &defaultfontpath)
bool isGLCompressImages() const
void setScreenHeight(uint16_t screenheight)
const std::string & getDefaultFontPath() const
float getInitialVolume() const
void setFrameLimit(uint16_t framelimit)
std::string getWindowTitle()
const std::string & getRenderBackend() const
uint8_t getBitsPerPixel() const
void setRenderBackend(const std::string &renderbackend)
void setScreenWidth(uint16_t screenwidth)
void setColorKey(uint8_t r, uint8_t g, uint8_t b)
std::vector< uint8_t > getPossibleBitsPerPixel() const
bool isSDLRemoveFakeAlpha() const
uint16_t getFrameLimit() const
bool isGLUseFramebuffer() const
void setGLUseNPOT(bool oglusenpot)
bool isFullScreen() const
void setBitsPerPixel(uint8_t bitsperpixel)
void setLightingModel(uint32_t lighting)
void setWindowIcon(const std::string &icon)
uint32_t getLightingModel() const
const std::string & getWindowIcon() const
std::string getRenderBackend()
const std::string & getDefaultFontGlyphs() const
std::vector< std::string > getPossibleRenderBackends()