diff options
| author | Stanislaw Halik <sthalik@misaki.pl> | 2022-10-09 00:28:44 +0200 |
|---|---|---|
| committer | Stanislaw Halik <sthalik@misaki.pl> | 2022-10-09 00:28:44 +0200 |
| commit | 23529e7ab310764cdf1b99015fce0814b4955210 (patch) | |
| tree | eb815cdd6e5365602685f4e9a0a12cba8fd80f5f /main/debug.cpp | |
| parent | 07d8adea58ec5b6b51704be1caf84012b0049313 (diff) | |
a
Diffstat (limited to 'main/debug.cpp')
| -rw-r--r-- | main/debug.cpp | 26 |
1 files changed, 18 insertions, 8 deletions
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<const app*>(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 |
