mirror of
https://github.com/glfw/glfw.git
synced 2024-11-26 20:11:58 +00:00
Only restore gamma ramp if it has been changed.
This commit is contained in:
parent
f5eb79ed28
commit
79bef68511
@ -129,7 +129,8 @@ int _glfwPlatformTerminate(void)
|
||||
}
|
||||
|
||||
// Restore the original gamma ramp
|
||||
_glfwPlatformSetGammaRamp(&_glfwLibrary.originalRamp);
|
||||
if (_glfwLibrary.rampChanged)
|
||||
_glfwPlatformSetGammaRamp(&_glfwLibrary.originalRamp);
|
||||
|
||||
CGDisplayModeRelease(_glfwLibrary.NS.desktopMode);
|
||||
|
||||
|
@ -112,5 +112,6 @@ GLFWAPI void glfwSetGammaRamp(const GLFWgammaramp* ramp)
|
||||
|
||||
_glfwPlatformSetGammaRamp(ramp);
|
||||
_glfwLibrary.currentRamp = *ramp;
|
||||
_glfwLibrary.rampChanged = GL_TRUE;
|
||||
}
|
||||
|
||||
|
@ -245,6 +245,7 @@ struct _GLFWlibrary
|
||||
GLFWgammaramp currentRamp;
|
||||
GLFWgammaramp originalRamp;
|
||||
int originalRampSize;
|
||||
GLboolean rampChanged;
|
||||
|
||||
// This is defined in the current port's platform.h
|
||||
_GLFW_PLATFORM_LIBRARY_WINDOW_STATE;
|
||||
|
@ -190,7 +190,8 @@ int _glfwPlatformInit(void)
|
||||
int _glfwPlatformTerminate(void)
|
||||
{
|
||||
// Restore the original gamma ramp
|
||||
_glfwPlatformSetGammaRamp(&_glfwLibrary.originalRamp);
|
||||
if (_glfwLibrary.rampChanged)
|
||||
_glfwPlatformSetGammaRamp(&_glfwLibrary.originalRamp);
|
||||
|
||||
if (_glfwLibrary.Win32.classAtom)
|
||||
{
|
||||
|
@ -659,7 +659,7 @@ static Cursor createNULLCursor(void)
|
||||
|
||||
static void terminateDisplay(void)
|
||||
{
|
||||
if (_glfwLibrary.originalRampSize)
|
||||
if (_glfwLibrary.originalRampSize && _glfwLibrary.rampChanged)
|
||||
_glfwPlatformSetGammaRamp(&_glfwLibrary.originalRamp);
|
||||
|
||||
if (_glfwLibrary.X11.display)
|
||||
|
Loading…
Reference in New Issue
Block a user