diff --git a/src/SFML/Window/CMakeLists.txt b/src/SFML/Window/CMakeLists.txt index dff51635..ee0d89a0 100644 --- a/src/SFML/Window/CMakeLists.txt +++ b/src/SFML/Window/CMakeLists.txt @@ -6,7 +6,6 @@ set(SRCROOT ${CMAKE_SOURCE_DIR}/src/SFML/Window) set(SRC ${INCROOT}/Export.h ${SRCROOT}/Context.cpp - ${SRCROOT}/ContextSettingsInternal.cpp ${SRCROOT}/ContextSettingsInternal.h ${SRCROOT}/ContextStruct.h ${INCROOT}/Context.h diff --git a/src/SFML/Window/ContextSettingsInternal.cpp b/src/SFML/Window/ContextSettingsInternal.cpp deleted file mode 100644 index 5d37f5a6..00000000 --- a/src/SFML/Window/ContextSettingsInternal.cpp +++ /dev/null @@ -1,67 +0,0 @@ -//////////////////////////////////////////////////////////// -// -// SFML - Simple and Fast Multimedia Library -// Copyright (C) 2007-2016 Laurent Gomila (laurent@sfml-dev.org) -// -// This software is provided 'as-is', without any express or implied warranty. -// In no event will the authors be held liable for any damages arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it freely, -// subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; -// you must not claim that you wrote the original software. -// If you use this software in a product, an acknowledgment -// in the product documentation would be appreciated but is not required. -// -// 2. Altered source versions must be plainly marked as such, -// and must not be misrepresented as being the original software. -// -// 3. This notice may not be removed or altered from any source distribution. -// -//////////////////////////////////////////////////////////// - -//////////////////////////////////////////////////////////// -// Headers -//////////////////////////////////////////////////////////// -#include - - -namespace priv -{ -//////////////////////////////////////////////////////////// -sfContextSettings sfContextSettings_null() -{ - sfContextSettings settings = {0, 0, 0, 0, 0, 0, sfFalse}; - - return settings; -} - - -//////////////////////////////////////////////////////////// -void sfContextSettings_readFromCpp(const sf::ContextSettings& from, sfContextSettings& to) -{ - to.depthBits = from.depthBits; - to.stencilBits = from.stencilBits; - to.antialiasingLevel = from.antialiasingLevel; - to.majorVersion = from.majorVersion; - to.minorVersion = from.minorVersion; - to.attributeFlags = from.attributeFlags; - to.sRgbCapable = from.sRgbCapable ? sfTrue : sfFalse; -} - - -//////////////////////////////////////////////////////////// -void sfContextSettings_writeToCpp(const sfContextSettings& from, sf::ContextSettings& to) -{ - to.depthBits = from.depthBits; - to.stencilBits = from.stencilBits; - to.antialiasingLevel = from.antialiasingLevel; - to.majorVersion = from.majorVersion; - to.minorVersion = from.minorVersion; - to.attributeFlags = from.attributeFlags; - to.sRgbCapable = from.sRgbCapable == sfTrue; -} - -} // namespace priv diff --git a/src/SFML/Window/ContextSettingsInternal.h b/src/SFML/Window/ContextSettingsInternal.h index ad0969a8..d1ce7afe 100644 --- a/src/SFML/Window/ContextSettingsInternal.h +++ b/src/SFML/Window/ContextSettingsInternal.h @@ -36,17 +36,40 @@ namespace priv //////////////////////////////////////////////////////////// // Create a "null" sfContextSettings that's returned in case of an error. //////////////////////////////////////////////////////////// - sfContextSettings sfContextSettings_null(); + inline sfContextSettings sfContextSettings_null() + { + sfContextSettings settings = {0, 0, 0, 0, 0, 0, sfFalse}; + + return settings; + } //////////////////////////////////////////////////////////// // Read the data of an sf::ContextSettings into an sfContextSettings //////////////////////////////////////////////////////////// - void sfContextSettings_readFromCpp(const sf::ContextSettings& from, sfContextSettings& to); + inline void sfContextSettings_readFromCpp(const sf::ContextSettings& from, sfContextSettings& to) + { + to.depthBits = from.depthBits; + to.stencilBits = from.stencilBits; + to.antialiasingLevel = from.antialiasingLevel; + to.majorVersion = from.majorVersion; + to.minorVersion = from.minorVersion; + to.attributeFlags = from.attributeFlags; + to.sRgbCapable = from.sRgbCapable ? sfTrue : sfFalse; + } //////////////////////////////////////////////////////////// // Write the data of an sfContextSettings into an sf::ContextSettings //////////////////////////////////////////////////////////// - void sfContextSettings_writeToCpp(const sfContextSettings& from, sf::ContextSettings& to); + inline void sfContextSettings_writeToCpp(const sfContextSettings& from, sf::ContextSettings& to) + { + to.depthBits = from.depthBits; + to.stencilBits = from.stencilBits; + to.antialiasingLevel = from.antialiasingLevel; + to.majorVersion = from.majorVersion; + to.minorVersion = from.minorVersion; + to.attributeFlags = from.attributeFlags; + to.sRgbCapable = from.sRgbCapable == sfTrue; + } } #endif // SFML_CONTEXTSETTINGSINTERNAL_H