summaryrefslogtreecommitdiff
path: root/src/mbgl/platform
diff options
context:
space:
mode:
authorThiago Marcos P. Santos <tmpsantos@gmail.com>2019-02-05 15:19:32 +0200
committerThiago Marcos P. Santos <tmpsantos@gmail.com>2019-02-12 19:42:08 +0200
commit9b66be7bef71d100579647d787b542d248952f88 (patch)
treecd37cc02e15dcc2819606632ee65c6961bb5b10f /src/mbgl/platform
parent1fadf563688785a51ce4fe935a7865d05e3e72a9 (diff)
downloadqtlocation-mapboxgl-9b66be7bef71d100579647d787b542d248952f88.tar.gz
[core] Abstract the OpenGL implementation
The platform will be responsible to load the OpenGL implementation and give the function pointers to Mapbox GL Core. The platform might load OpenGL by linking against some OpenGL implementation, load it dynamically, etc. It doesn't matter as long as it is a valid implementation. Also adds the `::platform` namespace where all the missing symbols and interfaces expected to be implemented by the platforms will live.
Diffstat (limited to 'src/mbgl/platform')
-rw-r--r--src/mbgl/platform/gl_functions.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/mbgl/platform/gl_functions.cpp b/src/mbgl/platform/gl_functions.cpp
new file mode 100644
index 0000000000..6eb7790ca2
--- /dev/null
+++ b/src/mbgl/platform/gl_functions.cpp
@@ -0,0 +1,17 @@
+#include <mbgl/platform/gl_functions.hpp>
+
+#include <mbgl/util/logging.hpp>
+
+namespace mbgl {
+namespace platform {
+
+#ifndef NDEBUG
+void glCheckError(const char* cmd, const char* file, int line) {
+ if (GLenum err = glGetError()) {
+ Log::Warning(Event::OpenGL, "Error %d: %s - %s:%d", err, cmd, file, line);
+ }
+}
+#endif
+
+} // namespace platform
+} // namespace mbgl