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 #include "video/renderbackend.h"
36 
37 namespace FIFE {
38  class NotSupported;
39 
44  public:
48 
52 
56  void setBitsPerPixel(uint8_t bitsperpixel);
57 
61  return m_bitsperpixel;
62  }
63 
66  std::vector<uint8_t> getPossibleBitsPerPixel() const;
67 
70  void setFullScreen(bool fullscreen) {
71  m_fullscreen = fullscreen;
72  }
73 
76  bool isFullScreen() const {
77  return m_fullscreen;
78  }
79 
83  void setInitialVolume(float volume);
84 
87  float getInitialVolume() const {
88  return m_initialvolume;
89  }
90 
93  float getMaxVolume() const;
94 
98  void setRenderBackend(const std::string& renderbackend);
99 
102  const std::string& getRenderBackend() const {
103  return m_renderbackend;
104  }
105 
108  std::string getRenderBackend() {
109  return m_renderbackend;
110  }
111 
114  std::vector<std::string> getPossibleRenderBackends();
115 
118  void setSDLRemoveFakeAlpha(bool sdlremovefakealpha);
119 
122  bool isSDLRemoveFakeAlpha() const {
123  return m_sdlremovefakealpha;
124  }
125 
128  void setGLCompressImages(bool oglcompressimages);
129 
132  bool isGLCompressImages() const {
133  return m_oglcompressimages;
134  }
135 
138  void setGLUseFramebuffer(bool ogluseframebuffer);
139 
142  bool isGLUseFramebuffer() const {
143  return m_ogluseframebuffer;
144  }
145 
148  void setGLUseNPOT(bool oglusenpot);
149 
152  bool isGLUseNPOT() const {
153  return m_oglusenpot;
154  }
155 
159 
163 
166  void setGLUseMipmapping(bool mipmapping);
167 
170  bool isGLUseMipmapping() const;
171 
174  void setGLUseMonochrome(bool monochrome);
175 
178  bool isGLUseMonochrome() const;
179 
182  void setGLUseDepthBuffer(bool buffer);
183 
186  bool isGLUseDepthBuffer() const;
187 
190  void setGLAlphaTestValue(float alpha);
191 
194  float getGLAlphaTestValue() const;
195 
198  void setScreenWidth(uint16_t screenwidth);
199 
203  return m_screenwidth;
204  }
205 
208  void setScreenHeight(uint16_t screenheight);
209 
213  return m_screenheight;
214  }
215 
218  void setDefaultFontPath(const std::string& defaultfontpath);
219 
222  const std::string& getDefaultFontPath() const {
223  return m_defaultfontpath;
224  }
225 
228  std::string getDefaultFontPath() {
229  return m_defaultfontpath;
230  }
231 
234  void setDefaultFontSize(uint16_t defaultfontsize);
235 
239  return m_defaultfontsize;
240  }
241 
244  void setDefaultFontGlyphs(const std::string& defaultfontglyphs);
245 
248  const std::string& getDefaultFontGlyphs() const {
249  return m_defaultfontglyphs;
250  }
251 
254  std::string getDefaultFontGlyphs() {
255  return m_defaultfontglyphs;
256  }
257 
260  void setWindowTitle(const std::string& title);
261 
264  const std::string& getWindowTitle() const {
265  return m_windowtitle;
266  }
267 
270  std::string getWindowTitle() {
271  return m_windowtitle;
272  }
273 
276  void setWindowIcon(const std::string& icon);
277 
280  const std::string& getWindowIcon() const {
281  return m_windowicon;
282  }
283 
286  std::string getWindowIcon() {
287  return m_windowicon;
288  }
289 
292  void setColorKeyEnabled(bool colorkeyenable);
293 
296  bool isColorKeyEnabled() const;
297 
300  void setColorKey(uint8_t r, uint8_t g, uint8_t b);
301 
304  const SDL_Color& getColorKey() const;
305 
306  void setVideoDriver(const std::string& driver);
307 
308  const std::string& getVideoDriver() const;
309 
312  void setLightingModel(uint32_t lighting);
313 
317  return m_lighting;
318  }
319 
322  void setFrameLimitEnabled(bool limited);
323 
326  bool isFrameLimitEnabled() const;
327 
330  void setFrameLimit(uint16_t framelimit);
331 
334  uint16_t getFrameLimit() const;
335 
338  void setMouseSensitivity(float sens);
339 
342  float getMouseSensitivity() const;
343 
348  void setMouseAccelerationEnabled(bool acceleration);
349 
354  bool isMouseAccelerationEnabled() const;
355 
356  private:
360  std::string m_renderbackend;
372  std::string m_windowtitle;
373  std::string m_windowicon;
374 
375 
376  std::string m_defaultfontpath;
378  std::string m_defaultfontglyphs;
380  SDL_Color m_colorkey;
381  std::string m_videodriver;
387  };
388 
389 }//FIFE
390 
391 #endif
392 
bool isGLUseMonochrome() const
Tells if OpenGL renderbackend should render only monochrome.
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.
TextureFiltering m_oglTextureFilter
EngineSettings()
Constructor.
void setMouseSensitivity(float sens)
Sets mouse sensitivity.
bool isFrameLimitEnabled() const
Gets whether the frame limiter is in use.
void setGLUseMonochrome(bool monochrome)
Sets if OpenGL renderbackend should render only monochrome.
void setGLTextureFiltering(TextureFiltering filter)
Sets texture filtering method for OpenGL renderbackend.
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.
bool isGLUseMipmapping() const
Tells if OpenGL renderbackend should use mipmapping.
void setDefaultFontPath(const std::string &defaultfontpath)
Sets path for default font.
void setGLUseDepthBuffer(bool buffer)
Sets if OpenGL renderbackend should use depth buffer.
void setGLUseMipmapping(bool mipmapping)
Sets if OpenGL renderbackend should use mipmapping.
bool isGLCompressImages() const
Tells if images are compress by video driver in OpenGL renderbackend.
TextureFiltering getGLTextureFiltering() const
Gets current texture filter which uses OpenGL.
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.
void setGLAlphaTestValue(float alpha)
Sets alpha test value for OpenGL renderbackend.
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.
float getGLAlphaTestValue() const
Gets current alpha test value which uses OpenGL.
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.
TextureFiltering
Definition: renderbackend.h:99
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
bool isGLUseDepthBuffer() const
Tells if OpenGL renderbackend should use depth buffer.
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.