mirror of
https://github.com/SFML/CSFML.git
synced 2026-10-27 21:36:13 +01:00
Merge pull request #119 from crumblingstatue/master
Inline the functions in ContextSettingsInternal
This commit is contained in:
commit
bca82a4c6b
3 files changed
+26
-71
No files matched your search
@@ -6,7 +6,6 @@ set(SRCROOT ${CMAKE_SOURCE_DIR}/src/SFML/Window)
|
|||||||
set(SRC
|
set(SRC
|
||||||
${INCROOT}/Export.h
|
${INCROOT}/Export.h
|
||||||
${SRCROOT}/Context.cpp
|
${SRCROOT}/Context.cpp
|
||||||
${SRCROOT}/ContextSettingsInternal.cpp
|
|
||||||
${SRCROOT}/ContextSettingsInternal.h
|
${SRCROOT}/ContextSettingsInternal.h
|
||||||
${SRCROOT}/ContextStruct.h
|
${SRCROOT}/ContextStruct.h
|
||||||
${INCROOT}/Context.h
|
${INCROOT}/Context.h
|
||||||
|
|||||||
@@ -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 <SFML/Window/ContextSettingsInternal.h>
|
|
||||||
|
|
||||||
|
|
||||||
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
|
|
||||||
@@ -36,17 +36,40 @@ namespace priv
|
|||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
// Create a "null" sfContextSettings that's returned in case of an error.
|
// 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
|
// 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
|
// 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
|
#endif // SFML_CONTEXTSETTINGSINTERNAL_H
|
||||||
Reference in new issue
Block a user