Skip to content

Commit

Permalink
Merge pull request #119 from crumblingstatue/master
Browse files Browse the repository at this point in the history
Inline the functions in ContextSettingsInternal
  • Loading branch information
LaurentGomila authored Nov 5, 2016
2 parents 8ec6eb0 + 6dca26e commit bca82a4
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 71 deletions.
1 change: 0 additions & 1 deletion src/SFML/Window/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
67 changes: 0 additions & 67 deletions src/SFML/Window/ContextSettingsInternal.cpp

This file was deleted.

29 changes: 26 additions & 3 deletions src/SFML/Window/ContextSettingsInternal.h
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit bca82a4

Please sign in to comment.