summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLeith Bade <leith@mapbox.com>2014-12-02 01:21:40 +1100
committerLeith Bade <leith@mapbox.com>2014-12-02 01:21:40 +1100
commitbbfe5d5ce4799dbfb55d4e4d44bc254592529c29 (patch)
tree5eb19256ba5b6810526bfe41d8d27dce9d856e00 /src
parent8f60624becbca685369925794d377d401652f761 (diff)
downloadqtlocation-mapboxgl-bbfe5d5ce4799dbfb55d4e4d44bc254592529c29.tar.gz
Define GL callback func. Improve GL err macro.
Diffstat (limited to 'src')
-rw-r--r--src/platform/gl.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/platform/gl.cpp b/src/platform/gl.cpp
index c9f76bf1d6..bec1136bb0 100644
--- a/src/platform/gl.cpp
+++ b/src/platform/gl.cpp
@@ -1,4 +1,5 @@
#include <mbgl/platform/gl.hpp>
+#include <mbgl/platform/log.hpp>
#include <iostream>
@@ -18,6 +19,10 @@ PFNGLGETOBJECTLABELPROC GetObjectLabel;
PFNGLOBJECTPTRLABELPROC ObjectPtrLabel;
PFNGLGETOBJECTPTRLABELPROC GetObjectPtrLabel;
+void debug_callback(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *message, const void *userParam) {
+ //mbgl::Error(mbgl::Event::OpenGL)
+}
+
PFNGLBINDVERTEXARRAYPROC BindVertexArray = nullptr;
PFNGLDELETEVERTEXARRAYSPROC DeleteVertexArrays = nullptr;
PFNGLGENVERTEXARRAYSPROC GenVertexArrays = nullptr;
@@ -39,9 +44,10 @@ void _CHECK_GL_ERROR(const char *cmd, const char *file, int line) {
case GL_INVALID_VALUE: error = "INVALID_VALUE"; break;
case GL_OUT_OF_MEMORY: error = "OUT_OF_MEMORY"; break;
case GL_INVALID_FRAMEBUFFER_OPERATION: error = "INVALID_FRAMEBUFFER_OPERATION"; break;
+ default: error = "(unknown)"; break;
}
- std::cerr << "GL_" << error.c_str() << " - " << file << ":" << line << std::endl;
+ mbgl::Log::Error(mbgl::Event::OpenGL, "GL_%s(0x%04X) - %s:%i", error.c_str(), file, line, err);
exit(1);
}
}