mirror of
https://github.com/SFML/CSFML.git
synced 2026-10-24 21:53:37 +02:00
Add missing sfContext_getSettings
This commit is contained in:
1 parent
dbc7147b47
commit
57eda5f923
2 files changed
+30
-1
No files matched your search
@@ -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
|
||||
@@ -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;
|
||||
}
|
||||
Reference in new issue
Block a user