2015-05-14 18:31:16 +00:00
|
|
|
#ifndef OPENMW_COMPONENTS_SDLUTIL_SDLVIDEOWRAPPER_H
|
|
|
|
#define OPENMW_COMPONENTS_SDLUTIL_SDLVIDEOWRAPPER_H
|
|
|
|
|
|
|
|
#include <osg/ref_ptr>
|
|
|
|
|
|
|
|
#include <SDL_types.h>
|
|
|
|
|
2023-10-27 10:24:42 +00:00
|
|
|
#include "vsyncmode.hpp"
|
|
|
|
|
2015-05-14 18:31:16 +00:00
|
|
|
struct SDL_Window;
|
|
|
|
|
|
|
|
namespace osgViewer
|
|
|
|
{
|
|
|
|
class Viewer;
|
|
|
|
}
|
|
|
|
|
2022-05-04 05:50:31 +00:00
|
|
|
namespace Settings
|
|
|
|
{
|
|
|
|
enum class WindowMode;
|
|
|
|
}
|
|
|
|
|
2015-05-14 18:31:16 +00:00
|
|
|
namespace SDLUtil
|
|
|
|
{
|
|
|
|
|
|
|
|
class VideoWrapper
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
VideoWrapper(SDL_Window* window, osg::ref_ptr<osgViewer::Viewer> viewer);
|
|
|
|
~VideoWrapper();
|
|
|
|
|
2023-10-27 10:24:42 +00:00
|
|
|
void setSyncToVBlank(VSyncMode vsyncMode);
|
2015-05-14 18:31:16 +00:00
|
|
|
|
|
|
|
void setGammaContrast(float gamma, float contrast);
|
|
|
|
|
2022-05-04 05:50:31 +00:00
|
|
|
void setVideoMode(int width, int height, Settings::WindowMode windowMode, bool windowBorder);
|
2015-05-14 18:31:16 +00:00
|
|
|
|
2020-07-14 17:54:50 +00:00
|
|
|
void centerWindow();
|
|
|
|
|
2015-05-14 18:31:16 +00:00
|
|
|
private:
|
|
|
|
SDL_Window* mWindow;
|
|
|
|
osg::ref_ptr<osgViewer::Viewer> mViewer;
|
|
|
|
|
|
|
|
float mGamma;
|
|
|
|
float mContrast;
|
|
|
|
bool mHasSetGammaContrast;
|
|
|
|
|
|
|
|
// Store system gamma ramp on window creation. Restore system gamma ramp on exit
|
|
|
|
Uint16 mOldSystemGammaRamp[256 * 3];
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|