本文整理汇总了C++中SDL_VideoDevice::GetGamma方法的典型用法代码示例。如果您正苦于以下问题:C++ SDL_VideoDevice::GetGamma方法的具体用法?C++ SDL_VideoDevice::GetGamma怎么用?C++ SDL_VideoDevice::GetGamma使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SDL_VideoDevice
的用法示例。
在下文中一共展示了SDL_VideoDevice::GetGamma方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SDL_GetGamma
/* Calculating the gamma by integrating the gamma ramps isn't exact,
so this function isn't officially supported.
*/
int SDL_GetGamma(float *red, float *green, float *blue)
{
int succeeded;
SDL_VideoDevice *video = current_video;
SDL_VideoDevice *this = current_video;
succeeded = -1;
#ifdef USE_MATH_H
/* Prefer using GetGammaRamp(), as it's more flexible */
{
Uint16 ramp[3][256];
succeeded = SDL_GetGammaRamp(ramp[0], ramp[1], ramp[2]);
if ( succeeded >= 0 ) {
CalculateGammaFromRamp(red, ramp[0]);
CalculateGammaFromRamp(green, ramp[1]);
CalculateGammaFromRamp(blue, ramp[2]);
}
}
#else
SDL_SetError("Gamma correction not supported");
#endif
if ( (succeeded < 0) && video->GetGamma ) {
SDL_ClearError();
succeeded = video->GetGamma(this, red, green, blue);
}
return succeeded;
}
示例2: SDL_GetGamma
int SDL_GetGamma(float *red, float *green, float *blue)
{
int succeeded;
SDL_VideoDevice *video = current_video;
SDL_VideoDevice *this = current_video;
succeeded = -1;
/* Prefer using GetGammaRamp(), as it's more flexible */
{
Uint16 ramp[3][256];
succeeded = SDL_GetGammaRamp(ramp[0], ramp[1], ramp[2]);
if ( succeeded >= 0 ) {
CalculateGammaFromRamp(red, ramp[0]);
CalculateGammaFromRamp(green, ramp[1]);
CalculateGammaFromRamp(blue, ramp[2]);
}
}
if ( (succeeded < 0) && video->GetGamma ) {
SDL_ClearError();
succeeded = video->GetGamma(this, red, green, blue);
}
return succeeded;
}