Mercurial > fife-parpg
diff engine/core/video/devicecaps.h @ 642:6e2151325017
* Added the ability to query the current running screen mode
* Added a method to detect the closest supported screen mode (not complete yet). If no matching screen modes are detected an exception is thrown.
* Small change to the way the screen is initialized. The screen mode now MUST be in the supported screen mode list before the screen will initialize.
author | prock@33b003aa-7bff-0310-803a-e67f0ece8222 |
---|---|
date | Fri, 08 Oct 2010 21:22:02 +0000 |
parents | 685d250f2c2d |
children | edf6dcfe8cd4 |
line wrap: on
line diff
--- a/engine/core/video/devicecaps.h Thu Oct 07 19:39:58 2010 +0000 +++ b/engine/core/video/devicecaps.h Fri Oct 08 21:22:02 2010 +0000 @@ -37,7 +37,6 @@ namespace FIFE { - class ScreenMode { public: /** Default Constructor @@ -80,6 +79,16 @@ */ bool isOpenGL() const { return (m_SDLFlags & SDL_OPENGL) ? true : false; }; + + //OpenGL, windowed, hw accel + static const uint32_t HW_WINDOWED_OPENGL = SDL_OPENGL | SDL_HWPALETTE | SDL_HWACCEL; + //OpenGL, fullscreen, hw accel + static const uint32_t HW_FULLSCREEN_OPENGL = SDL_OPENGL | SDL_HWPALETTE | SDL_HWACCEL | SDL_FULLSCREEN; + //SDL, windowed + static const uint32_t WINDOWED_SDL = 0; + //SDL, fullscreen + static const uint32_t FULLSCREEN_SDL = SDL_FULLSCREEN; + private: uint16_t m_width; uint16_t m_height; @@ -114,6 +123,10 @@ */ std::vector<ScreenMode> getSupportedScreenModes() const { return m_screenModes; }; + /** Gets the nearest valid screen mode based on the arguments passed + */ + ScreenMode getNearestScreenMode(uint32_t width, uint32_t height, uint32_t bpp, const std::string& renderer, bool fs) const; + /** Returns the name of the current video driver. */ std::string getDriverName() const { return m_driverName; }; @@ -179,6 +192,8 @@ */ void fillAvailableDrivers(); }; //DeviceCaps -} +} //FIFE + + #endif //FIFE_DEVICECAPS_H