summaryrefslogtreecommitdiffhomepage
path: root/main/debug.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'main/debug.cpp')
-rw-r--r--main/debug.cpp26
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