Replace const char* with std::string_view

This commit is contained in:
Chris Thrasher 2024-05-23 12:05:43 -06:00 committed by Vittorio Romeo
parent 51676b65db
commit b583eaf160
4 changed files with 5 additions and 4 deletions

View File

@ -34,6 +34,7 @@
#include <SFML/System/Vector2.hpp> #include <SFML/System/Vector2.hpp>
#include <memory> #include <memory>
#include <string_view>
#include <cstdint> #include <cstdint>
@ -126,7 +127,7 @@ public:
/// \return True if available, false if unavailable /// \return True if available, false if unavailable
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
static bool isExtensionAvailable(const char* name); static bool isExtensionAvailable(std::string_view name);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Get the address of an OpenGL function /// \brief Get the address of an OpenGL function

View File

@ -126,7 +126,7 @@ std::uint64_t Context::getActiveContextId()
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
bool Context::isExtensionAvailable(const char* name) bool Context::isExtensionAvailable(std::string_view name)
{ {
return priv::GlContext::isExtensionAvailable(name); return priv::GlContext::isExtensionAvailable(name);
} }

View File

@ -665,7 +665,7 @@ std::unique_ptr<GlContext> GlContext::create(const ContextSettings& settings, co
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
bool GlContext::isExtensionAvailable(const char* name) bool GlContext::isExtensionAvailable(std::string_view name)
{ {
// If this function is called before any context is available, // If this function is called before any context is available,
// the shared context will be created for the duration of this call // the shared context will be created for the duration of this call

View File

@ -138,7 +138,7 @@ public:
/// \return True if available, false if unavailable /// \return True if available, false if unavailable
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
static bool isExtensionAvailable(const char* name); static bool isExtensionAvailable(std::string_view name);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Get the address of an OpenGL function /// \brief Get the address of an OpenGL function