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:
authorExMix <rahuba.youri@mapswithme.com>2015-03-30 17:26:00 +0300
committerr.kuznetsov <r.kuznetsov@corp.mail.ru>2015-11-30 16:04:14 +0300
commit16f3381b84d872d7eaacde23ca3b9abac7544ca3 (patch)
tree166e6c29298a7506fab7c4da4cf7c032b1f4d152 /drape/vertex_array_buffer.cpp
parentcf0e88b3b7090370e69d05ec760b690d11dbb7ce (diff)
[drape] render range of indices
Diffstat (limited to 'drape/vertex_array_buffer.cpp')
-rw-r--r--drape/vertex_array_buffer.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/drape/vertex_array_buffer.cpp b/drape/vertex_array_buffer.cpp
index f91230bb5c..b6cd98c602 100644
--- a/drape/vertex_array_buffer.cpp
+++ b/drape/vertex_array_buffer.cpp
@@ -49,6 +49,11 @@ void VertexArrayBuffer::Preflush()
void VertexArrayBuffer::Render()
{
+ RenderRange(IndicesRange{ 0, m_indexBuffer->GetBuffer()->GetCurrentSize() });
+}
+
+void VertexArrayBuffer::RenderRange(IndicesRange const & range)
+{
if (!(m_staticBuffers.empty() && m_dynamicBuffers.empty()) && m_indexBuffer->GetBuffer()->GetCurrentSize() > 0)
{
ASSERT(!m_program.IsNull(), ("Somebody not call Build. It's very bad. Very very bad"));
@@ -61,7 +66,7 @@ void VertexArrayBuffer::Render()
BindDynamicBuffers();
m_indexBuffer->GetBuffer()->Bind();
- GLFunctions::glDrawElements(m_indexBuffer->GetBuffer()->GetCurrentSize());
+ GLFunctions::glDrawElements(range.m_idxCount, range.m_idxStart);
}
}
@@ -181,6 +186,11 @@ uint16_t VertexArrayBuffer::GetDynamicBufferOffset(BindingInfo const & bindingIn
return GetOrCreateDynamicBuffer(bindingInfo)->GetBuffer()->GetCurrentSize();
}
+uint16_t VertexArrayBuffer::GetIndexCount() const
+{
+ return m_indexBuffer->GetBuffer()->GetCurrentSize();
+}
+
bool VertexArrayBuffer::IsFilled() const
{
return GetAvailableIndexCount() < 3 || GetAvailableVertexCount() < 3;