diff options
author | Leith Bade <leith@mapbox.com> | 2014-12-20 14:15:33 +1300 |
---|---|---|
committer | Leith Bade <leith@mapbox.com> | 2014-12-20 15:08:06 +1300 |
commit | 15b47197a79c05ca6fe4f604a7803ecbcb7a7e4d (patch) | |
tree | 54539846e3bb827a09ba56bf25c867502a49b40a /platform | |
parent | 4a2cf4aa62b9f467f0757844b4a4c3dbf75fdc40 (diff) | |
download | qtlocation-mapboxgl-15b47197a79c05ca6fe4f604a7803ecbcb7a7e4d.tar.gz |
Use iostream for saving GL program binary. Also check for GL_NUM_PROGRAM_BINARY_FORMATS > 0.
Diffstat (limited to 'platform')
-rw-r--r-- | platform/default/glfw_view.cpp | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/platform/default/glfw_view.cpp b/platform/default/glfw_view.cpp index e33f8eed15..21cd95c8bf 100644 --- a/platform/default/glfw_view.cpp +++ b/platform/default/glfw_view.cpp @@ -152,12 +152,16 @@ void GLFWView::initialize(mbgl::Map *map_) { } if (extensions.find("GL_ARB_get_program_binary") != std::string::npos) { - gl::GetProgramBinary = (gl::PFNGLGETPROGRAMBINARYPROC)glfwGetProcAddress("glGetProgramBinary"); - gl::ProgramBinary = (gl::PFNGLPROGRAMBINARYPROC)glfwGetProcAddress("glProgramBinary"); - gl::ProgramParameteri = (gl::PFNGLPROGRAMPARAMETERIPROC)glfwGetProcAddress("glProgramParameteri"); - assert(gl::GetProgramBinary != nullptr); - assert(gl::ProgramBinary != nullptr); - assert(gl::ProgramParameteri != nullptr); + GLint numBinaryFormats; + MBGL_CHECK_ERROR(glGetIntegerv(GL_NUM_PROGRAM_BINARY_FORMATS, &numBinaryFormats)); + if (numBinaryFormats > 0) { + gl::GetProgramBinary = (gl::PFNGLGETPROGRAMBINARYPROC)glfwGetProcAddress("glGetProgramBinary"); + gl::ProgramBinary = (gl::PFNGLPROGRAMBINARYPROC)glfwGetProcAddress("glProgramBinary"); + gl::ProgramParameteri = (gl::PFNGLPROGRAMPARAMETERIPROC)glfwGetProcAddress("glProgramParameteri"); + assert(gl::GetProgramBinary != nullptr); + assert(gl::ProgramBinary != nullptr); + assert(gl::ProgramParameteri != nullptr); + } } } |