summaryrefslogtreecommitdiffhomepage
path: root/main
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2023-01-16 04:45:44 +0100
committerStanislaw Halik <sthalik@misaki.pl>2023-01-16 04:45:44 +0100
commit1a3a4c6c03e6d975f059c5eb3271006eb4b5a926 (patch)
tree91b42853cb6bf613076859ff7a6b2d28eecf6b99 /main
parent36a08e45fc185d1f93b952f960edfadc28fce1c2 (diff)
main/debug: fix after magnum update
Diffstat (limited to 'main')
-rw-r--r--main/debug.cpp11
-rw-r--r--main/main-impl.hpp2
2 files changed, 7 insertions, 6 deletions
diff --git a/main/debug.cpp b/main/debug.cpp
index 14f6131e..70a1b1e8 100644
--- a/main/debug.cpp
+++ b/main/debug.cpp
@@ -6,7 +6,7 @@ namespace floormat {
using Severity = GL::DebugOutput::Severity;
// NOLINTNEXTLINE(readability-convert-member-functions-to-static)
-void main_impl::debug_callback(unsigned src, unsigned type, unsigned id, unsigned severity, const std::string& str) const
+void main_impl::debug_callback(unsigned src, unsigned type, unsigned id, unsigned severity, StringView str) const
{
static thread_local auto clock = std::chrono::steady_clock{};
static const auto t0 = clock.now();
@@ -20,9 +20,9 @@ void main_impl::debug_callback(unsigned src, unsigned type, unsigned id, unsigne
#endif
(void)src; (void)type;
- const char* p = str.c_str();
- if (str.starts_with("Buffer detailed info: "))
- p = str.data() + sizeof("Buffer detailed info: ") - 1;
+ const char* p = str.data();
+ if (str.hasPrefix("Buffer detailed info: "_s))
+ p += sizeof("Buffer detailed info: ") - 1;
using seconds = std::chrono::duration<double>;
const auto t = std::chrono::duration_cast<seconds>(clock.now() - t0).count();
@@ -52,11 +52,12 @@ void main_impl::debug_callback(unsigned src, unsigned type, unsigned id, unsigne
}
static void _debug_callback(GL::DebugOutput::Source src, GL::DebugOutput::Type type, UnsignedInt id,
- GL::DebugOutput::Severity severity, const std::string& str, const void* self)
+ GL::DebugOutput::Severity severity, StringView str, const void* self)
{
static_cast<const main_impl*>(self)->debug_callback((unsigned)src, (unsigned)type, (unsigned)id, (unsigned)severity, str);
}
+
void main_impl::register_debug_callback()
{
GL::DebugOutput::setEnabled(GL::DebugOutput::Source::Api, GL::DebugOutput::Type::Other, {131185}, false); // nvidia krap
diff --git a/main/main-impl.hpp b/main/main-impl.hpp
index 3e60ff68..43add3bf 100644
--- a/main/main-impl.hpp
+++ b/main/main-impl.hpp
@@ -67,7 +67,7 @@ struct main_impl final : Platform::Sdl2Application, floormat_main
void start_text_input() noexcept override;
void stop_text_input() noexcept override;
- void debug_callback(unsigned src, unsigned type, unsigned id, unsigned severity, const std::string& str) const;
+ void debug_callback(unsigned src, unsigned type, unsigned id, unsigned severity, StringView str) const;
void set_cursor(std::uint32_t cursor) noexcept override;
std::uint32_t cursor() const noexcept override;