SampleUtils: print GLFW errors for debugging
diff --git a/examples/SampleUtils.cpp b/examples/SampleUtils.cpp
index c641dc0..5fe6750 100644
--- a/examples/SampleUtils.cpp
+++ b/examples/SampleUtils.cpp
@@ -28,6 +28,10 @@
std::cout << "Device error: " << message << std::endl;
}
+void PrintGLFWError(int code, const char* message) {
+ std::cout << "GLFW error: " << code << " - " << message << std::endl;
+}
+
enum class CmdBufType {
None,
Terrible,
@@ -64,6 +68,7 @@
return nxt::Device();
}
+ glfwSetErrorCallback(PrintGLFWError);
if (!glfwInit()) {
return nxt::Device();
}