mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-01-16 00:41:18 -06:00
Add the optional ability to print a stacktrace with an OpenGL error (closes #1700)
This commit is contained in:
@@ -74,6 +74,7 @@
|
||||
#include <ghoul/logging/logmanager.h>
|
||||
#include <ghoul/logging/visualstudiooutputlog.h>
|
||||
#include <ghoul/misc/profiling.h>
|
||||
#include <ghoul/misc/stacktrace.h>
|
||||
#include <ghoul/misc/stringconversion.h>
|
||||
#include <ghoul/opengl/debugcontext.h>
|
||||
#include <ghoul/opengl/shaderpreprocessor.h>
|
||||
@@ -560,6 +561,15 @@ void OpenSpaceEngine::initializeGL() {
|
||||
default:
|
||||
throw ghoul::MissingCaseException();
|
||||
}
|
||||
|
||||
if (global::configuration->openGLDebugContext.printStacktrace) {
|
||||
std::string stackString = "Stacktrace\n";
|
||||
std::vector<std::string> stack = ghoul::stackTrace();
|
||||
for (size_t i = 0; i < stack.size(); i++) {
|
||||
stackString += fmt::format("{}: {}\n", i, stack[i]);
|
||||
}
|
||||
LDEBUGC(category, stackString);
|
||||
}
|
||||
};
|
||||
ghoul::opengl::debug::setDebugCallback(callback);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user