From b583eaf1606e54e5f443b094b3b2a6e3af72a5a4 Mon Sep 17 00:00:00 2001 From: Chris Thrasher Date: Thu, 23 May 2024 12:05:43 -0600 Subject: [PATCH] Replace `const char*` with `std::string_view` --- include/SFML/Window/Context.hpp | 3 ++- src/SFML/Window/Context.cpp | 2 +- src/SFML/Window/GlContext.cpp | 2 +- src/SFML/Window/GlContext.hpp | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/include/SFML/Window/Context.hpp b/include/SFML/Window/Context.hpp index 2f7af96cd..f9d4667f7 100644 --- a/include/SFML/Window/Context.hpp +++ b/include/SFML/Window/Context.hpp @@ -34,6 +34,7 @@ #include #include +#include #include @@ -126,7 +127,7 @@ public: /// \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 diff --git a/src/SFML/Window/Context.cpp b/src/SFML/Window/Context.cpp index e92b52d26..46656f9bd 100644 --- a/src/SFML/Window/Context.cpp +++ b/src/SFML/Window/Context.cpp @@ -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); } diff --git a/src/SFML/Window/GlContext.cpp b/src/SFML/Window/GlContext.cpp index 510af4164..6e0ca1f88 100644 --- a/src/SFML/Window/GlContext.cpp +++ b/src/SFML/Window/GlContext.cpp @@ -665,7 +665,7 @@ std::unique_ptr 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, // the shared context will be created for the duration of this call diff --git a/src/SFML/Window/GlContext.hpp b/src/SFML/Window/GlContext.hpp index 1fae56989..17669bed4 100644 --- a/src/SFML/Window/GlContext.hpp +++ b/src/SFML/Window/GlContext.hpp @@ -138,7 +138,7 @@ public: /// \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