diff --git a/include/SFML/Window/Context.h b/include/SFML/Window/Context.h index 87789a3..74ad061 100644 --- a/include/SFML/Window/Context.h +++ b/include/SFML/Window/Context.h @@ -32,6 +32,8 @@ #include #include +typedef void (*GlFunctionPointer)(); + //////////////////////////////////////////////////////////// /// \brief Create a new context /// @@ -71,6 +73,16 @@ CSFML_WINDOW_API sfBool sfContext_isExtensionAvailable(const char* name); //////////////////////////////////////////////////////////// CSFML_WINDOW_API sfBool sfContext_setActive(sfContext* context, sfBool active); +//////////////////////////////////////////////////////////// +/// \brief Get the address of an OpenGL function. +/// +/// \param name Name of the function to get the address of +/// +/// \return Address of the OpenGL function, 0 on failure +/// +//////////////////////////////////////////////////////////// +CSFML_WINDOW_API GlFunctionPointer sfContext_getFunction(const char* name); + //////////////////////////////////////////////////////////// /// \brief Get the settings of the context. /// diff --git a/src/SFML/Window/Context.cpp b/src/SFML/Window/Context.cpp index 949d658..6b47578 100644 --- a/src/SFML/Window/Context.cpp +++ b/src/SFML/Window/Context.cpp @@ -59,6 +59,13 @@ sfBool sfContext_setActive(sfContext* context, sfBool active) } +//////////////////////////////////////////////////////////// +GlFunctionPointer sfContext_getFunction(const char* name) +{ + return sf::Context::getFunction(name); +} + + //////////////////////////////////////////////////////////// sfContextSettings sfContext_getSettings(const sfContext* context) {