Add missing sfContext_getSettings

This commit is contained in:
Mika Attila committed 2016-10-25 15:28:22 +02:00
1 parent dbc7147b47
commit 57eda5f923
2 files changed
+30 -1

No files matched your search

+12 -1
View File
@@ -30,7 +30,7 @@
////////////////////////////////////////////////////////////
#include <SFML/Window/Export.h>
#include <SFML/Window/Types.h>
#include <SFML/Window/Window.h>
////////////////////////////////////////////////////////////
/// \brief Create a new context
@@ -61,5 +61,16 @@ CSFML_WINDOW_API void sfContext_destroy(sfContext* context);
////////////////////////////////////////////////////////////
CSFML_WINDOW_API sfBool sfContext_setActive(sfContext* context, sfBool active);
////////////////////////////////////////////////////////////
/// \brief Get the settings of the context.
///
/// Note that these settings may be different than the ones passed to the
/// constructor; they are indeed adjusted if the original settings are not
/// directly supported by the system.
///
/// \return Structure containing the settings
///
////////////////////////////////////////////////////////////
CSFML_WINDOW_API sfContextSettings sfContext_getSettings(const sfContext* context);
#endif // SFML_CONTEXT_H
+18
View File
@@ -49,3 +49,21 @@ sfBool sfContext_setActive(sfContext* context, sfBool active)
{
CSFML_CALL_RETURN(context, setActive(active == sfTrue), false)
}
////////////////////////////////////////////////////////////
sfContextSettings sfContext_getSettings(const sfContext* context)
{
sfContextSettings settings = {0, 0, 0, 0, 0};
CSFML_CHECK_RETURN(context, settings);
const sf::ContextSettings& params = context->This.getSettings();
settings.depthBits = params.depthBits;
settings.stencilBits = params.stencilBits;
settings.antialiasingLevel = params.antialiasingLevel;
settings.majorVersion = params.majorVersion;
settings.minorVersion = params.minorVersion;
settings.attributeFlags = params.attributeFlags;
return settings;
}