mirror of
https://github.com/minetest/irrlicht.git
synced 2025-06-30 23:30:27 +02:00
Drop gamma ramp code
We definitely won't be wanting to set the gamma for the entire display in the future.
This commit is contained in:
@ -1763,97 +1763,6 @@ void CIrrDeviceLinux::pollJoysticks()
|
||||
}
|
||||
|
||||
|
||||
//! Set the current Gamma Value for the Display
|
||||
bool CIrrDeviceLinux::setGammaRamp( f32 red, f32 green, f32 blue, f32 brightness, f32 contrast )
|
||||
{
|
||||
#if defined(_IRR_LINUX_X11_VIDMODE_) || defined(_IRR_LINUX_X11_RANDR_)
|
||||
s32 eventbase, errorbase;
|
||||
#ifdef _IRR_LINUX_X11_VIDMODE_
|
||||
if (XF86VidModeQueryExtension(XDisplay, &eventbase, &errorbase))
|
||||
{
|
||||
XF86VidModeGamma gamma;
|
||||
gamma.red=red;
|
||||
gamma.green=green;
|
||||
gamma.blue=blue;
|
||||
XF86VidModeSetGamma(XDisplay, Screennr, &gamma);
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
#if defined(_IRR_LINUX_X11_VIDMODE_) && defined(_IRR_LINUX_X11_RANDR_)
|
||||
else
|
||||
#endif
|
||||
#ifdef _IRR_LINUX_X11_RANDR_
|
||||
if (XRRQueryExtension(XDisplay, &eventbase, &errorbase))
|
||||
{
|
||||
XRRQueryVersion(XDisplay, &eventbase, &errorbase); // major, minor
|
||||
if (eventbase>=1 && errorbase>1)
|
||||
{
|
||||
#if (RANDR_MAJOR>1 || RANDR_MINOR>1)
|
||||
XRRCrtcGamma *gamma = XRRGetCrtcGamma(XDisplay, Screennr);
|
||||
if (gamma)
|
||||
{
|
||||
*gamma->red=(u16)red;
|
||||
*gamma->green=(u16)green;
|
||||
*gamma->blue=(u16)blue;
|
||||
XRRSetCrtcGamma(XDisplay, Screennr, gamma);
|
||||
XRRFreeGamma(gamma);
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
//! Get the current Gamma Value for the Display
|
||||
bool CIrrDeviceLinux::getGammaRamp( f32 &red, f32 &green, f32 &blue, f32 &brightness, f32 &contrast )
|
||||
{
|
||||
brightness = 0.f;
|
||||
contrast = 0.f;
|
||||
#if defined(_IRR_LINUX_X11_VIDMODE_) || defined(_IRR_LINUX_X11_RANDR_)
|
||||
s32 eventbase, errorbase;
|
||||
#ifdef _IRR_LINUX_X11_VIDMODE_
|
||||
if (XF86VidModeQueryExtension(XDisplay, &eventbase, &errorbase))
|
||||
{
|
||||
XF86VidModeGamma gamma;
|
||||
XF86VidModeGetGamma(XDisplay, Screennr, &gamma);
|
||||
red = gamma.red;
|
||||
green = gamma.green;
|
||||
blue = gamma.blue;
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
#if defined(_IRR_LINUX_X11_VIDMODE_) && defined(_IRR_LINUX_X11_RANDR_)
|
||||
else
|
||||
#endif
|
||||
#ifdef _IRR_LINUX_X11_RANDR_
|
||||
if (XRRQueryExtension(XDisplay, &eventbase, &errorbase))
|
||||
{
|
||||
XRRQueryVersion(XDisplay, &eventbase, &errorbase); // major, minor
|
||||
if (eventbase>=1 && errorbase>1)
|
||||
{
|
||||
#if (RANDR_MAJOR>1 || RANDR_MINOR>1)
|
||||
XRRCrtcGamma *gamma = XRRGetCrtcGamma(XDisplay, Screennr);
|
||||
if (gamma)
|
||||
{
|
||||
red = *gamma->red;
|
||||
green = *gamma->green;
|
||||
blue= *gamma->blue;
|
||||
XRRFreeGamma(gamma);
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
//! gets text from the clipboard
|
||||
//! \return Returns 0 if no string is in there, otherwise utf-8 text.
|
||||
const c8 *CIrrDeviceLinux::getTextFromClipboard() const
|
||||
|
Reference in New Issue
Block a user