From 23529e7ab310764cdf1b99015fce0814b4955210 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Sun, 9 Oct 2022 00:28:44 +0200 Subject: a --- main/debug.cpp | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) (limited to 'main/debug.cpp') diff --git a/main/debug.cpp b/main/debug.cpp index 7e7e3abf..ee160136 100644 --- a/main/debug.cpp +++ b/main/debug.cpp @@ -4,32 +4,42 @@ namespace Magnum::Examples { using Feature = GL::Renderer::Feature; -using Severity = GL::DebugOutput::Severity; +using Source = GL::DebugOutput::Source; using Type = GL::DebugOutput::Type; +using Severity = GL::DebugOutput::Severity; using GL::Renderer; using GL::DebugOutput; +// NOLINTNEXTLINE(readability-convert-member-functions-to-static) void app::debug_callback(GL::DebugOutput::Source src, GL::DebugOutput::Type type, UnsignedInt id, - GL::DebugOutput::Severity severity, const std::string& str) const + Severity severity, Containers::StringView str) const { - std::fputs(str.c_str(), stdout); - std::fputc('\n', stdout); + [[maybe_unused]] volatile auto _type = type; + [[maybe_unused]] volatile auto _id = id; + [[maybe_unused]] volatile auto _src = src; + [[maybe_unused]] volatile auto _severity = severity; + [[maybe_unused]] volatile const char* _str = str.data(); + + std::puts(str.data()); std::fflush(stdout); - std::puts(""); // put breakpoint here + std::fputs("", stdout); // put breakpoint here } 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, Containers::StringView str, const void* self) { static_cast(self)->debug_callback(src, type, id, severity, str); } -void app::register_debug_callback() +void* app::register_debug_callback() { GL::Renderer::setFeature(Feature::DebugOutput, true); GL::Renderer::setFeature(Feature::DebugOutputSynchronous, true); GL::DebugOutput::setCallback(_debug_callback, this); - GL::DebugOutput::setEnabled(Severity::High, true); + GL::DebugOutput::setEnabled(true); + //GL::DebugOutput::setEnabled(Severity::Notification, false); + + return nullptr; } } // namespace Magnum::Examples -- cgit v1.2.3