From dfd021b1505fb3924ae103d8aa27c6200d6ec3fd Mon Sep 17 00:00:00 2001 From: David Gow Date: Thu, 14 Aug 2014 21:44:14 +0800 Subject: [PATCH] Re-fix QuadTree GPU rendering, discard groups --- src/document.cpp | 2 ++ src/objectrenderer.cpp | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/document.cpp b/src/document.cpp index 16cb8f9..35673d4 100644 --- a/src/document.cpp +++ b/src/document.cpp @@ -130,6 +130,8 @@ int Document::ClipObjectToQuadChild(int object_id, QuadTreeNodeChildren type) m_objects.data_indices.push_back(m_objects.data_indices[object_id]); return 1; } + case GROUP: + break; default: Debug("Adding %s -> %s", m_objects.bounds[object_id].Str().c_str(), TransformToQuadChild(m_objects.bounds[object_id], type).Str().c_str()); m_objects.bounds.push_back(TransformToQuadChild(m_objects.bounds[object_id], type)); diff --git a/src/objectrenderer.cpp b/src/objectrenderer.cpp index ed4db41..42ec8fd 100644 --- a/src/objectrenderer.cpp +++ b/src/objectrenderer.cpp @@ -42,7 +42,7 @@ void ObjectRenderer::RenderUsingGPU(unsigned first_obj_id, unsigned last_obj_id) m_shader_program.Use(); m_ibo.Bind(); - glDrawElements(GL_LINES, (last_index-first_index)*2, GL_UNSIGNED_INT, (GLvoid*)(first_index*sizeof(uint32_t))); + glDrawElements(GL_LINES, (last_index-first_index)*2, GL_UNSIGNED_INT, (GLvoid*)(2*first_index*sizeof(uint32_t))); } @@ -329,7 +329,7 @@ void BezierRenderer::RenderUsingGPU(unsigned first_obj_id, unsigned last_obj_id) glUniform1i(m_shader_program.GetUniformLocation("bezier_buffer_texture"), 0); glUniform1i(m_shader_program.GetUniformLocation("bezier_id_buffer_texture"), 1); m_ibo.Bind(); - glDrawElements(GL_LINES, (last_index-first_index)*2, GL_UNSIGNED_INT, (GLvoid*)(first_index*sizeof(uint32_t))); + glDrawElements(GL_LINES, (last_index-first_index)*2, GL_UNSIGNED_INT, (GLvoid*)(2*first_index*sizeof(uint32_t))); } /** -- 2.20.1