From aed28415ed592425bd77894822b2db5b23ab3afd Mon Sep 17 00:00:00 2001 From: Mika Attila Date: Mon, 31 Oct 2016 14:05:21 +0100 Subject: [PATCH] Add sRgbCapable field to sfContextSettings --- include/SFML/Window/Window.h | 1 + src/SFML/Window/ContextSettingsInternal.cpp | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/include/SFML/Window/Window.h b/include/SFML/Window/Window.h index 0c60a05..6fe24de 100644 --- a/include/SFML/Window/Window.h +++ b/include/SFML/Window/Window.h @@ -75,6 +75,7 @@ typedef struct unsigned int majorVersion; ///< Major number of the context version to create unsigned int minorVersion; ///< Minor number of the context version to create sfUint32 attributeFlags; ///< The attribute flags to create the context with + sfBool sRgbCapable; ///< Whether the context framebuffer is sRGB capable } sfContextSettings; diff --git a/src/SFML/Window/ContextSettingsInternal.cpp b/src/SFML/Window/ContextSettingsInternal.cpp index 9f557fa..5d37f5a 100644 --- a/src/SFML/Window/ContextSettingsInternal.cpp +++ b/src/SFML/Window/ContextSettingsInternal.cpp @@ -33,7 +33,7 @@ namespace priv //////////////////////////////////////////////////////////// sfContextSettings sfContextSettings_null() { - sfContextSettings settings = {0, 0, 0, 0, 0, 0}; + sfContextSettings settings = {0, 0, 0, 0, 0, 0, sfFalse}; return settings; } @@ -48,6 +48,7 @@ void sfContextSettings_readFromCpp(const sf::ContextSettings& from, sfContextSet to.majorVersion = from.majorVersion; to.minorVersion = from.minorVersion; to.attributeFlags = from.attributeFlags; + to.sRgbCapable = from.sRgbCapable ? sfTrue : sfFalse; } @@ -60,6 +61,7 @@ void sfContextSettings_writeToCpp(const sfContextSettings& from, sf::ContextSett to.majorVersion = from.majorVersion; to.minorVersion = from.minorVersion; to.attributeFlags = from.attributeFlags; + to.sRgbCapable = from.sRgbCapable == sfTrue; } } // namespace priv