Skip to content

Commit

Permalink
CStdGL: Ignore any SetDeviceGammaRamp errors on Windows
Browse files Browse the repository at this point in the history
On some devices this function fails without any apparent reason and
returns nonsensical error values that we can't handle. As the log
message is very annoying and the function is part of the fallback
code path for screen gamma, just ignore any errors and don't log them.
  • Loading branch information
Fulgen301 committed Nov 14, 2024
1 parent 47c4af9 commit 923243c
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/StdGLCtx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -225,10 +225,7 @@ bool CStdGL::SaveDefaultGammaRampToMonitor(CStdWindow *pWindow)
bool CStdGL::ApplyGammaRampToMonitor(CGammaControl &ramp, bool fForce)
{
if (!MainCtx.hDC || (!Active && !fForce)) return false;
if (!SetDeviceGammaRamp(MainCtx.hDC, ramp.red))
{
logger->error("Error setting gamma ramp: {:02x}", ::GetLastError());
}
SetDeviceGammaRamp(MainCtx.hDC, ramp.red);
return true;
}

Expand Down

0 comments on commit 923243c

Please sign in to comment.