summaryrefslogtreecommitdiff
path: root/in_practice/breakout/gl_utils.c
diff options
context:
space:
mode:
Diffstat (limited to 'in_practice/breakout/gl_utils.c')
-rw-r--r--in_practice/breakout/gl_utils.c75
1 files changed, 75 insertions, 0 deletions
diff --git a/in_practice/breakout/gl_utils.c b/in_practice/breakout/gl_utils.c
new file mode 100644
index 0000000..fc1e3af
--- /dev/null
+++ b/in_practice/breakout/gl_utils.c
@@ -0,0 +1,75 @@
+#include "gl_utils.h"
+#include "sys.h"
+
+extern void gl_debug_output(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *message, const void *user_param)
+{
+ /* ignore these non-significant error codes */
+ if(id == 131169 || id == 131185 || id == 131218 || id == 131204)
+ return;
+ if (user_param)
+ info("user parameters doesn't supported");
+ info("debug message (%d length: %d): %s", id, length, message);
+ switch (source) {
+ case GL_DEBUG_SOURCE_API:
+ info("source: api");
+ break;
+ case GL_DEBUG_SOURCE_WINDOW_SYSTEM:
+ info("source: window system");
+ break;
+ case GL_DEBUG_SOURCE_SHADER_COMPILER:
+ info("source: shader compiler");
+ break;
+ case GL_DEBUG_SOURCE_THIRD_PARTY:
+ info("source: third party");
+ break;
+ case GL_DEBUG_SOURCE_APPLICATION:
+ info("source: application");
+ break;
+ case GL_DEBUG_SOURCE_OTHER:
+ info("source: other");
+ break;
+ }
+ switch (type) {
+ case GL_DEBUG_TYPE_ERROR:
+ info("type: error");
+ break;
+ case GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR:
+ info("type: deprecated behaviour");
+ break;
+ case GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR:
+ info("type: undefined behaviour");
+ break;
+ case GL_DEBUG_TYPE_PORTABILITY:
+ info("type: portability");
+ break;
+ case GL_DEBUG_TYPE_PERFORMANCE:
+ info("type: performance");
+ break;
+ case GL_DEBUG_TYPE_MARKER:
+ info("type: marker");
+ break;
+ case GL_DEBUG_TYPE_PUSH_GROUP:
+ info("type: push group");
+ break;
+ case GL_DEBUG_TYPE_POP_GROUP:
+ info("type: pop group");
+ break;
+ case GL_DEBUG_TYPE_OTHER:
+ info("type: other");
+ break;
+ }
+ switch (severity) {
+ case GL_DEBUG_SEVERITY_HIGH:
+ info("severity: high");
+ break;
+ case GL_DEBUG_SEVERITY_MEDIUM:
+ info("severity: medium");
+ break;
+ case GL_DEBUG_SEVERITY_LOW:
+ info("severity: low");
+ break;
+ case GL_DEBUG_SEVERITY_NOTIFICATION:
+ info("severity: notification");
+ break;
+ }
+}