|
@@ -240,7 +240,7 @@ nk_glfw3_render(struct nk_glfw* glfw, enum nk_anti_aliasing AA, int max_vertex_b
|
|
/* convert from command queue into draw list and draw to screen */
|
|
/* convert from command queue into draw list and draw to screen */
|
|
const struct nk_draw_command *cmd;
|
|
const struct nk_draw_command *cmd;
|
|
void *vertices, *elements;
|
|
void *vertices, *elements;
|
|
- const nk_draw_index *offset = NULL;
|
|
|
|
|
|
+ nk_size offset = 0;
|
|
|
|
|
|
/* allocate vertex and element buffer */
|
|
/* allocate vertex and element buffer */
|
|
glBindVertexArray(dev->vao);
|
|
glBindVertexArray(dev->vao);
|
|
@@ -292,8 +292,8 @@ nk_glfw3_render(struct nk_glfw* glfw, enum nk_anti_aliasing AA, int max_vertex_b
|
|
(GLint)((glfw->height - (GLint)(cmd->clip_rect.y + cmd->clip_rect.h)) * glfw->fb_scale.y),
|
|
(GLint)((glfw->height - (GLint)(cmd->clip_rect.y + cmd->clip_rect.h)) * glfw->fb_scale.y),
|
|
(GLint)(cmd->clip_rect.w * glfw->fb_scale.x),
|
|
(GLint)(cmd->clip_rect.w * glfw->fb_scale.x),
|
|
(GLint)(cmd->clip_rect.h * glfw->fb_scale.y));
|
|
(GLint)(cmd->clip_rect.h * glfw->fb_scale.y));
|
|
- glDrawElements(GL_TRIANGLES, (GLsizei)cmd->elem_count, GL_UNSIGNED_SHORT, offset);
|
|
|
|
- offset += cmd->elem_count;
|
|
|
|
|
|
+ glDrawElements(GL_TRIANGLES, (GLsizei)cmd->elem_count, GL_UNSIGNED_SHORT, (const void*) offset);
|
|
|
|
+ offset += cmd->elem_count * sizeof(nk_draw_index);
|
|
}
|
|
}
|
|
nk_clear(&glfw->ctx);
|
|
nk_clear(&glfw->ctx);
|
|
nk_buffer_clear(&dev->cmds);
|
|
nk_buffer_clear(&dev->cmds);
|