tl;dr: needed more * by 2.
iab;wtd*: The index buffers on the GPU contain _two_ elements per object,
one for the top left of the object's bounding box, one for the bottom-right.
We were taking that into account when computing the number of indices to give
the DrawElements() call, but not when calculating the offset into the buffer.
Oops.
*: I am bored; want tedious detail
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)));
}
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)));
}
/**