fix circle rendering over new impl
This commit is contained in:
@ -65,9 +65,9 @@ VertexBuffer get_circle_element_buffer(void) {
|
||||
|
||||
if (buffer == 0) {
|
||||
buffer = create_vertex_buffer();
|
||||
VertexBufferBuilder builder = build_vertex_buffer(buffer, sizeof (GLshort) * (CIRCLE_VERTICES_MAX - 1) * 3);
|
||||
VertexBufferBuilder builder = build_vertex_buffer(buffer, sizeof (GLshort) * (CIRCLE_VERTICES_MAX - 2) * 3);
|
||||
|
||||
for (size_t i = 1; i < CIRCLE_VERTICES_MAX; ++i) {
|
||||
for (size_t i = 1; i < CIRCLE_VERTICES_MAX - 1; ++i) {
|
||||
/* first one is center point index, always zero */
|
||||
GLshort indices[3];
|
||||
|
||||
@ -76,10 +76,7 @@ VertexBuffer get_circle_element_buffer(void) {
|
||||
/* generated point index */
|
||||
indices[1] = (GLshort)i;
|
||||
|
||||
size_t index = (i + 1) % (CIRCLE_VERTICES_MAX - 1);
|
||||
if (index == 0) /* don't use center for outer ring */
|
||||
index = (CIRCLE_VERTICES_MAX - 1);
|
||||
indices[2] = (GLshort)index;
|
||||
indices[2] = (GLshort)i + 1;
|
||||
|
||||
push_to_vertex_buffer_builder(&builder, indices, sizeof indices);
|
||||
}
|
||||
|
Reference in New Issue
Block a user