Moved X11 gamma ramp termination to gamma module.

This commit is contained in:
Camilla Berglund 2012-05-31 01:34:21 +02:00
parent 20fccd4aa3
commit 322407ae9f
3 changed files with 14 additions and 3 deletions

View File

@ -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 ////// ////// GLFW platform API //////
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////

View File

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

View File

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