Moved X11 gamma ramp termination to gamma module.

master
Camilla Berglund ago%!(EXTRA string=13 years)
parent 20fccd4aa3
commit 322407ae9f
  1. 11
      src/x11_gamma.c
  2. 5
      src/x11_init.c
  3. 1
      src/x11_platform.h

@ -90,6 +90,17 @@ void _glfwInitGammaRamp(void)
}
//========================================================================
// Restore original gamma ramp if necessary
//========================================================================
void _glfwTerminateGammaRamp(void)
{
if (_glfwLibrary.originalRampSize && _glfwLibrary.rampChanged)
_glfwPlatformSetGammaRamp(&_glfwLibrary.originalRamp);
}
//////////////////////////////////////////////////////////////////////////
////// GLFW platform API //////
//////////////////////////////////////////////////////////////////////////

@ -659,9 +659,6 @@ static Cursor createNULLCursor(void)
static void terminateDisplay(void)
{
if (_glfwLibrary.originalRampSize && _glfwLibrary.rampChanged)
_glfwPlatformSetGammaRamp(&_glfwLibrary.originalRamp);
if (_glfwLibrary.X11.display)
{
XCloseDisplay(_glfwLibrary.X11.display);
@ -713,6 +710,8 @@ int _glfwPlatformTerminate(void)
_glfwLibrary.X11.cursor = (Cursor) 0;
}
_glfwTerminateGammaRamp();
terminateDisplay();
_glfwTerminateJoysticks();

@ -285,6 +285,7 @@ void _glfwInitTimer(void);
// Gamma
void _glfwInitGammaRamp(void);
void _glfwTerminateGammaRamp(void);
// Fullscreen support
int _glfwGetClosestVideoMode(int* width, int* height, int* rate);

Loading…
Cancel
Save