diff --git a/runtime/Display/Display.cpp b/runtime/Display/Display.cpp index c66779a68..a1bd50553 100644 --- a/runtime/Display/Display.cpp +++ b/runtime/Display/Display.cpp @@ -142,41 +142,6 @@ namespace spartan void get_gamma() { - - #ifdef _WIN32 - HDC hdc = GetDC(nullptr); // get the device context for the primary monitor - if (!hdc) - { - SP_LOG_ERROR("Failed to get device context"); - return; - } - - WORD gammaRamp[3][256]; - if (GetDeviceGammaRamp(hdc, gammaRamp)) - { - // normalize the gamma ramp values and calculate the gamma value - float sum = 0.0f; - for (int i = 0; i < 256; ++i) - { - // normalize the red channel value to [0, 1] - float normalizedValue = static_cast(gammaRamp[0][i]) / 65535.0f; - // accumulate the normalized value - sum += normalizedValue; - } - - // calculate the average normalized value - float averageValue = sum / 256.0f; - // estimate gamma as the inverse of the average value - *gamma = 1.0f / averageValue; - } - else - { - SP_LOG_ERROR("Failed to get gamma ramp"); - } - - ReleaseDC(nullptr, hdc); - - #elif defined(__linux__) gamma = 2.2f; Uint16 gammaRamp[256]; if (SDL_GetWindowGammaRamp(static_cast(Window::GetHandleSDL()), gammaRamp, gammaRamp, gammaRamp) == 0) @@ -199,7 +164,6 @@ namespace spartan { SP_LOG_ERROR(std::string("Unable to get gamma ramp: ") + std::string(SDL_GetError())) } - #endif } }