From 9b66be7bef71d100579647d787b542d248952f88 Mon Sep 17 00:00:00 2001 From: "Thiago Marcos P. Santos" Date: Tue, 5 Feb 2019 15:19:32 +0200 Subject: [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. --- src/mbgl/platform/gl_functions.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 src/mbgl/platform/gl_functions.cpp (limited to 'src/mbgl/platform') 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 + +#include + +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 -- cgit v1.2.1