Add gamma support to SDL device.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@2572 dfc29bdd-3216-0410-991c-e03cc46cb475
master
hybrid 2009-08-06 15:42:59 +00:00
parent 3248afa977
commit 308ba13567
2 changed files with 21 additions and 0 deletions

View File

@ -778,6 +778,21 @@ bool CIrrDeviceSDL::isWindowMinimized() const
}
//! Set the current Gamma Value for the Display
bool CIrrDeviceSDL::setGammaRamp( f32 red, f32 green, f32 blue, f32 brightness, f32 contrast )
{
return (SDL_SetGamma(red, green, blue) != -1);
}
//! Get the current Gamma Value for the Display
bool CIrrDeviceSDL::getGammaRamp( f32 &red, f32 &green, f32 &blue, f32 &brightness, f32 &contrast )
{
brightness = 0.f;
contrast = 0.f;
return (SDL_GetGamma(&red, &green, &blue) != -1);
}
//! returns color format of the window.
video::ECOLOR_FORMAT CIrrDeviceSDL::getColorFormat() const
{

View File

@ -74,6 +74,12 @@ namespace irr
//! Activate any joysticks, and generate events for them.
virtual bool activateJoysticks(core::array<SJoystickInfo> & joystickInfo);
//! Set the current Gamma Value for the Display
virtual bool setGammaRamp( f32 red, f32 green, f32 blue, f32 brightness, f32 contrast );
//! Get the current Gamma Value for the Display
virtual bool getGammaRamp( f32 &red, f32 &green, f32 &blue, f32 &brightness, f32 &contrast );
//! Get the device type
virtual E_DEVICE_TYPE getType() const
{