Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaria Volvenkova <d.volvenkova@corp.mail.ru>2015-11-22 21:16:07 +0300
committerDaria Volvenkova <d.volvenkova@corp.mail.ru>2015-12-29 16:36:03 +0300
commit5082c0f0aadbf84d261d356f5b8b68566d1371cb (patch)
tree21a13fea98a6aaef726e0ae0ec6313bec6ad8ea5 /drape/vertex_array_buffer.cpp
parentb3f994948d75edce0753a2f907db61793df8a610 (diff)
Rebuild vertex array buffers after switch between 2d and 3d mode.
Diffstat (limited to 'drape/vertex_array_buffer.cpp')
-rw-r--r--drape/vertex_array_buffer.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/drape/vertex_array_buffer.cpp b/drape/vertex_array_buffer.cpp
index ea1d353477..b4ea02b6b9 100644
--- a/drape/vertex_array_buffer.cpp
+++ b/drape/vertex_array_buffer.cpp
@@ -94,7 +94,9 @@ void VertexArrayBuffer::Build(ref_ptr<GpuProgram> program)
if (m_moveToGpuOnBuild && !m_isPreflushed)
PreflushImpl();
- ASSERT(m_VAO == 0 && m_program == nullptr, ("No-no-no! You can't rebuild VertexArrayBuffer"));
+ if (m_VAO != 0 && m_program == program)
+ return;
+
m_program = program;
/// if OES_vertex_array_object not supported, than buffers will be bind on each Render call
if (!GLExtensionsList::Instance().IsSupported(GLExtensionsList::VertexArrayObject))
@@ -103,6 +105,8 @@ void VertexArrayBuffer::Build(ref_ptr<GpuProgram> program)
if (m_staticBuffers.empty())
return;
+ if (m_VAO != 0)
+ GLFunctions::glDeleteVertexArray(m_VAO);
m_VAO = GLFunctions::glGenVertexArray();
Bind();
BindStaticBuffers();