Make glCheckError take a std::string_view rather than constructing a std::filesystem::path on error checks

This commit is contained in:
Bambo-Borris 2024-12-24 15:32:36 +00:00 committed by Chris Thrasher
parent c31b12690a
commit 8db4a58ce0
4 changed files with 6 additions and 6 deletions

View File

@ -36,11 +36,11 @@
namespace sf::priv
{
////////////////////////////////////////////////////////////
bool glCheckError(const std::filesystem::path& file, unsigned int line, std::string_view expression)
bool glCheckError(std::string_view file, unsigned int line, std::string_view expression)
{
const auto logError = [&](const char* error, const char* description)
{
err() << "An internal OpenGL call failed in " << file.filename() << "(" << line << ")."
err() << "An internal OpenGL call failed in " << std::filesystem::path(file).filename() << "(" << line << ")."
<< "\nExpression:\n " << expression << "\nError description:\n " << error << "\n " << description << '\n'
<< std::endl;

View File

@ -50,7 +50,7 @@ namespace sf::priv
/// \return `false` if an error occurred, `true` otherwise
///
////////////////////////////////////////////////////////////
bool glCheckError(const std::filesystem::path& file, unsigned int line, std::string_view expression);
bool glCheckError(std::string_view file, unsigned int line, std::string_view expression);
////////////////////////////////////////////////////////////
/// Macro to quickly check every OpenGL API call

View File

@ -38,11 +38,11 @@
namespace sf::priv
{
////////////////////////////////////////////////////////////
bool eglCheckError(const std::filesystem::path& file, unsigned int line, std::string_view expression)
bool eglCheckError(std::string_view file, unsigned int line, std::string_view expression)
{
const auto logError = [&](const char* error, const char* description)
{
err() << "An internal EGL call failed in " << file.filename() << "(" << line << ")."
err() << "An internal EGL call failed in " << std::filesystem::path(file).filename() << "(" << line << ")."
<< "\nExpression:\n " << expression << "\nError description:\n " << error << "\n " << description << '\n'
<< std::endl;

View File

@ -50,7 +50,7 @@ namespace sf::priv
/// \return `false` if an error occurred, `true` otherwise
///
////////////////////////////////////////////////////////////
bool eglCheckError(const std::filesystem::path& file, unsigned int line, std::string_view expression);
bool eglCheckError(std::string_view file, unsigned int line, std::string_view expression);
////////////////////////////////////////////////////////////
/// Macro to quickly check every EGL API call