X-Git-Url: https://git.ucc.asn.au/?p=ipdf%2Fcode.git;a=blobdiff_plain;f=src%2Fobjectrenderer.cpp;h=8349bc1c7b721e5efba5e59d92a2c837352cdae5;hp=ed4db414ad838534c57c1168c6331e2146876d12;hb=6dd539966821debd18e0b86ed126742cd81d7fc9;hpb=2a1715c907ba3ccfb952e9630c3fe305655637e0 diff --git a/src/objectrenderer.cpp b/src/objectrenderer.cpp index ed4db41..8349bc1 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))); } @@ -281,10 +281,9 @@ void BezierRenderer::PrepareBezierGPUBuffer(const Objects& objects) BufferBuilder builder(m_bezier_coeffs.Map(false, true, true), m_bezier_coeffs.GetSize()); - for (unsigned i = 0; i < objects.types.size(); ++i) + for (unsigned i = 0; i < objects.beziers.size(); ++i) { - if (objects.types[i] != BEZIER) continue; - const Bezier & bez = objects.beziers[objects.data_indices[i]];//objects.beziers[objects.data_indices[i]].CopyInverse(objects.bounds[i]); + const Bezier & bez = objects.beziers[i]; GPUBezierCoeffs coeffs = { Float(bez.x0), Float(bez.y0), @@ -329,7 +328,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))); } /**