Skip to content

Commit

Permalink
Implements sfContext_getFunction
Browse files Browse the repository at this point in the history
  • Loading branch information
Luhrel authored and eXpl0it3r committed Oct 27, 2022
1 parent ade13ca commit 38a06ad
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
12 changes: 12 additions & 0 deletions include/SFML/Window/Context.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
#include <SFML/Window/Types.h>
#include <SFML/Window/Window.h>

typedef void (*GlFunctionPointer)();

////////////////////////////////////////////////////////////
/// \brief Create a new context
///
Expand Down Expand Up @@ -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.
///
Expand Down
7 changes: 7 additions & 0 deletions src/SFML/Window/Context.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down

0 comments on commit 38a06ad

Please sign in to comment.