draw: use GLint in circle element buffer
This commit is contained in:
parent
5e89710458
commit
09eac707c3
@ -87,15 +87,15 @@ IndexBuffer get_circle_element_buffer(void) {
|
|||||||
|
|
||||||
if (buffer == 0) {
|
if (buffer == 0) {
|
||||||
buffer = create_index_buffer();
|
buffer = create_index_buffer();
|
||||||
IndexBufferBuilder builder = build_index_buffer(buffer, sizeof (GLshort) * (CIRCLE_VERTICES_MAX - 2) * 3);
|
IndexBufferBuilder builder = build_index_buffer(buffer, sizeof (GLint) * (CIRCLE_VERTICES_MAX - 2) * 3);
|
||||||
|
|
||||||
for (size_t i = 1; i < CIRCLE_VERTICES_MAX - 1; ++i) {
|
for (size_t i = 1; i < CIRCLE_VERTICES_MAX - 1; ++i) {
|
||||||
/* first one is center point index, always zero */
|
/* first one is center point index, always zero */
|
||||||
((GLshort *)builder.base)[(i - 1) * 3 + 0] = 0;
|
((GLint *)builder.base)[(i - 1) * 3 + 0] = 0;
|
||||||
|
|
||||||
/* generated point index */
|
/* generated point index */
|
||||||
((GLshort *)builder.base)[(i - 1) * 3 + 1] = (GLshort)i;
|
((GLint *)builder.base)[(i - 1) * 3 + 1] = (GLint)i;
|
||||||
((GLshort *)builder.base)[(i - 1) * 3 + 2] = (GLshort)i + 1;
|
((GLint *)builder.base)[(i - 1) * 3 + 2] = (GLint)i + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
finish_index_builder(&builder);
|
finish_index_builder(&builder);
|
||||||
|
Loading…
Reference in New Issue
Block a user