-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Description
This bug report was migrated from our old Bugzilla tracker.
These attachments are available in the static archive:
Reported in version: HG 2.1
Reported for operating system, platform: Other, x86
Comments on the original bug report:
On 2014-05-19 21:29:39 +0000, Eric Wasylishen wrote:
Created attachment 1656
patches SDL test programs to accept a --brightness flagEntering fullscreen mode with SDL_SetWindowFullscreen(window, SDL_WINDOW_FULLSCREEN) when you previously set a custom brightness level with SDL_SetWindowBrightness() resets the window brightness to the default.
Steps to reproduce:
- the attached patch adds a --brightness flag to the test programs
- launch testdraw2 with "--brightness 0.25". The window should be very dark.
- press Control+Enter to enter fullscreen.
Expected: the low brightness level persists in fullscreen mode
Observed: the demo graphics have reverted to regular brightness in fullscreen modeTested on Mac OS X 10.9.2 with the latest sdl2 from hg.
On 2014-05-31 18:50:45 +0000, Eric Wasylishen wrote:
It appears that the OS resets the display gamma to the default around 2 seconds after we do a display mode change. I verified that it's not SDL erroneously resetting the gamma.
Also, simply calling Cocoa_SetWindowGammaRamp(_this, window, window->gamma); at the end of Cocoa_SetWindowFullscreen doesn't fix the problem.
On 2016-05-27 23:57:27 +0000, Daniel Gibson wrote:
As one can probably expect from Eric's observations, this also affects SDL_SetWindowGammaRamp() of course.
We had this issue reported for Yamagi Quake2 (yquake2/yquake2#134), just so you know more people are affected by this ;-)
Any idea why OSX does this?
Any ideas/plans for a workaround in SDL? Would probably be ugly as hell to re-set the gamma settings 2 seconds (is it even always exactly two seconds?) after changing resolution or switching from/to fullscreen..
On 2016-05-28 21:29:47 +0000, Eric Wasylishen wrote:
I haven't looked at this in 2 years since reporting, but in Quakespasm we gave up on the SDL brightness API's and switched to doing gamma in a postprocessing fragment shader, only falling back to SDL_SetWindowBrightness on OpenGL 1.x. This has the added benefit of not messing up the gamma of your entire monitor when running in a window.
I think these SDL_SetWindowBrightness/GammaRamp API's should be deprecated if it's not possible to fix them.
On 2017-08-19 03:42:08 +0000, Alex Szpakowski wrote:
I think these SDL_SetWindowBrightness/GammaRamp API's should be deprecated if it's not possible to fix them.
Agreed. I also remember getting annoyed at some of Valve's games in macOS for setting the display gamma via window brightness APIs and causing everything to be much more blue than how I had calibrated my display. (Not sure if they still do this or not, it was a few years ago.)
I think window brightness / gamma APIs made a lot more sense in the era before shaders were ubiquitous, but since they can't even work properly and shaders can easily replace them these days, I'd be happy if they were gone.