summaryrefslogtreecommitdiff
path: root/src/SFML/Window/GlContext.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/SFML/Window/GlContext.hpp')
-rw-r--r--src/SFML/Window/GlContext.hpp28
1 files changed, 26 insertions, 2 deletions
diff --git a/src/SFML/Window/GlContext.hpp b/src/SFML/Window/GlContext.hpp
index 8c4ce01..abcda4b 100644
--- a/src/SFML/Window/GlContext.hpp
+++ b/src/SFML/Window/GlContext.hpp
@@ -73,10 +73,22 @@ public:
static void globalCleanup();
////////////////////////////////////////////////////////////
- /// \brief Ensures that an OpenGL context is active in the current thread
+ /// \brief Empty function for ABI compatibility, use acquireTransientContext instead
///
////////////////////////////////////////////////////////////
static void ensureContext();
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Acquires a context for short-term use on the current thread
+ ///
+ ////////////////////////////////////////////////////////////
+ static void acquireTransientContext();
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Releases a context after short-term use on the current thread
+ ///
+ ////////////////////////////////////////////////////////////
+ static void releaseTransientContext();
////////////////////////////////////////////////////////////
/// \brief Create a new context, not associated to a window
@@ -121,6 +133,16 @@ public:
public:
////////////////////////////////////////////////////////////
+ /// \brief Check whether a given OpenGL extension is available
+ ///
+ /// \param name Name of the extension to check for
+ ///
+ /// \return True if available, false if unavailable
+ ///
+ ////////////////////////////////////////////////////////////
+ static bool isExtensionAvailable(const char* name);
+
+ ////////////////////////////////////////////////////////////
/// \brief Get the address of an OpenGL function
///
/// \param name Name of the function to get the address of
@@ -197,10 +219,12 @@ protected:
/// \brief Activate the context as the current target
/// for rendering
///
+ /// \param current Whether to make the context current or no longer current
+ ///
/// \return True on success, false if any error happened
///
////////////////////////////////////////////////////////////
- virtual bool makeCurrent() = 0;
+ virtual bool makeCurrent(bool current) = 0;
////////////////////////////////////////////////////////////
/// \brief Evaluate a pixel format configuration