diff options
author | Leith Bade <leith@mapbox.com> | 2014-12-11 00:09:26 +1100 |
---|---|---|
committer | Leith Bade <leith@mapbox.com> | 2014-12-11 00:09:26 +1100 |
commit | d599fc55043c60c282648ab7ef68b4f29d3ac35c (patch) | |
tree | 1b3bcd44e5fa3b384a62c1cdd6261977052fa150 /src/mbgl/platform | |
parent | 6bb1a5a146bcffde0f5f25587413c5fb076890b5 (diff) | |
parent | 0c62cd06552597966adb99183eb5ca78901a6087 (diff) | |
download | qtlocation-mapboxgl-d599fc55043c60c282648ab7ef68b4f29d3ac35c.tar.gz |
Merge branch 'master' of github.com:mapbox/mapbox-gl-native into android-mason
Conflicts:
platform/default/glfw_view.cpp
platform/default/headless_view.cpp
src/mbgl/renderer/painter.cpp
src/mbgl/renderer/prerendered_texture.cpp
Diffstat (limited to 'src/mbgl/platform')
-rw-r--r-- | src/mbgl/platform/gl.cpp | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/src/mbgl/platform/gl.cpp b/src/mbgl/platform/gl.cpp index f99883a4e5..91565f12c3 100644 --- a/src/mbgl/platform/gl.cpp +++ b/src/mbgl/platform/gl.cpp @@ -78,26 +78,28 @@ PFNGLGETPROGRAMBINARYPROC GetProgramBinary = nullptr; PFNGLPROGRAMBINARYPROC ProgramBinary = nullptr; PFNGLPROGRAMPARAMETERIPROC ProgramParameteri = nullptr; -} -} - -void _CHECK_GL_ERROR(const char *cmd, const char *file, int line) { - std::cout << cmd << ";" << std::endl; - - GLenum err; - - while ((err = glGetError()) != GL_NO_ERROR) { - std::string error; +void checkError(const char *cmd, const char *file, int line) { + const GLenum err = glGetError(); + if (err != GL_NO_ERROR) { + const char *error = nullptr; switch (err) { - case GL_INVALID_OPERATION: error = "INVALID_OPERATION"; break; case GL_INVALID_ENUM: error = "INVALID_ENUM"; break; case GL_INVALID_VALUE: error = "INVALID_VALUE"; break; - case GL_OUT_OF_MEMORY: error = "OUT_OF_MEMORY"; break; + case GL_INVALID_OPERATION: error = "INVALID_OPERATION"; break; case GL_INVALID_FRAMEBUFFER_OPERATION: error = "INVALID_FRAMEBUFFER_OPERATION"; break; + case GL_OUT_OF_MEMORY: error = "OUT_OF_MEMORY"; break; +#ifdef GL_STACK_UNDERFLOW + case GL_STACK_UNDERFLOW: error = "STACK_UNDERFLOW"; break; +#endif +#ifdef GL_STACK_OVERFLOW + case GL_STACK_OVERFLOW: error = "STACK_OVERFLOW"; break; +#endif default: error = "(unknown)"; break; } - mbgl::Log::Error(mbgl::Event::OpenGL, "GL_%s (0x%04X) - %s:%i", error.c_str(), file, line, err); - exit(1); + throw ::mbgl::gl::Error(err, std::string(cmd) + ": Error GL_" + error + " - " + file + ":" + std::to_string(line)); } } + +} +} |