FIFE
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
enginesettings.h
Go to the documentation of this file.
1 /***************************************************************************
2  * Copyright (C) 2005-2013 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 
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 
162  return m_screenwidth;
163  }
164 
167  void setScreenHeight(uint16_t screenheight);
168 
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 
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 
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 setMouseAccelerationEnabled(bool acceleration);
308 
313  bool isMouseAccelerationEnabled() const;
314 
315  private:
319  std::string m_renderbackend;
326  std::string m_windowtitle;
327  std::string m_windowicon;
328 
329 
330  std::string m_defaultfontpath;
332  std::string m_defaultfontglyphs;
334  SDL_Color m_colorkey;
335  std::string m_videodriver;
341  };
342 
343 }//FIFE
344 
345 #endif
346 
std::string getDefaultFontGlyphs()
Gets current glyphs for default font.
void setDefaultFontSize(uint16_t defaultfontsize)
Sets size for default font.
This class defines the engine settings on engine init.
float getMaxVolume() const
Gets maximum volume that can be set.
std::string getDefaultFontPath()
Gets current path for default font.
bool isColorKeyEnabled() const
Gets whether the colorkey feature is in use.
~EngineSettings()
Destructor.
void setGLUseFramebuffer(bool ogluseframebuffer)
Sets if OpenGL renderbackend should use FramebufferObject (when available)
void setFrameLimitEnabled(bool limited)
Sets whether to use the frame limiter.
void setInitialVolume(float volume)
Sets initial engine sound volume.
void setSDLRemoveFakeAlpha(bool sdlremovefakealpha)
Sets if fake alpha is removed in SDL renderbackend.
void setDefaultFontGlyphs(const std::string &defaultfontglyphs)
Sets glyphs for default font.
EngineSettings()
Constructor.
void setMouseSensitivity(float sens)
Sets mouse sensitivity.
bool isFrameLimitEnabled() const
Gets whether the frame limiter is in use.
std::string m_defaultfontglyphs
std::string getWindowIcon()
Gets the icon in the window title bar.
void setFullScreen(bool fullscreen)
Sets fullscreen / windowed mode.
uint16_t getDefaultFontSize() const
Gets size for default font.
uint16_t getScreenHeight() const
Gets screen height (pixels)
void setColorKeyEnabled(bool colorkeyenable)
Sets whether to use the colorkey feature.
const SDL_Color & getColorKey() const
Gets the global colorkey setting.
const std::string & getVideoDriver() const
const std::string & getWindowTitle() const
Gets the current window title.
bool isGLUseNPOT() const
Tells if OpenGL renderbackend should use NPOT Textures.
void setGLCompressImages(bool oglcompressimages)
Sets if images are compress by video driver in OpenGL renderbackend.
uint16_t getScreenWidth() const
Gets screen width (pixels)
void setWindowTitle(const std::string &title)
Sets the title of the window.
unsigned char uint8_t
Definition: core.h:38
float getMouseSensitivity() const
Gets mouse sensitivity.
void setDefaultFontPath(const std::string &defaultfontpath)
Sets path for default font.
bool isGLCompressImages() const
Tells if images are compress by video driver in OpenGL renderbackend.
std::string m_defaultfontpath
void setScreenHeight(uint16_t screenheight)
Sets screen height (pixels)
const std::string & getDefaultFontPath() const
Gets current path for default font.
float getInitialVolume() const
Gets initial engine sound volume.
void setFrameLimit(uint16_t framelimit)
Sets the frame limit.
std::string getWindowTitle()
Gets the current window title.
const std::string & getRenderBackend() const
Gets currently set renderbackend name.
uint8_t getBitsPerPixel() const
Gets currently set bits per pixel value.
void setRenderBackend(const std::string &renderbackend)
Sets name for renderbackend.
unsigned short uint16_t
Definition: core.h:39
void setScreenWidth(uint16_t screenwidth)
Sets screen width (pixels)
void setColorKey(uint8_t r, uint8_t g, uint8_t b)
Sets the global colorkey to use for images.
std::vector< uint8_t > getPossibleBitsPerPixel() const
Gets all possible bits per pixel values.
bool isMouseAccelerationEnabled() const
Returns if mouse acceleration is enabled or not.
bool isSDLRemoveFakeAlpha() const
Tells if fake alpha is removed in SDL renderbackend.
std::string m_windowtitle
uint16_t getFrameLimit() const
Gets the frame limit.
std::string m_windowicon
bool isGLUseFramebuffer() const
Tells if OpenGL renderbackend should use FramebufferObject.
void setGLUseNPOT(bool oglusenpot)
Sets if OpenGL renderbackend should use NPOT Textures (when available)
bool isFullScreen() const
True, if set to fullscreen.
void setBitsPerPixel(uint8_t bitsperpixel)
Sets bits per pixel.
void setMouseAccelerationEnabled(bool acceleration)
Sets mouse acceleration if mouse acceleration is enabled, then the mouse sensitivity is used as speed...
void setLightingModel(uint32_t lighting)
Sets the light model.
void setWindowIcon(const std::string &icon)
Sets the icon that appears in the window title bar.
uint32_t getLightingModel() const
Gets the currently set light model.
void setVideoDriver(const std::string &driver)
std::string m_videodriver
const std::string & getWindowIcon() const
Gets the icon in the window title bar.
unsigned int uint32_t
Definition: core.h:40
std::string getRenderBackend()
Gets currently set renderbackend name.
const std::string & getDefaultFontGlyphs() const
Gets current glyphs for default font.
std::string m_renderbackend
std::vector< std::string > getPossibleRenderBackends()
Gets all possible renderbackend names.