Clear cmds nk_buffer after each frame to stop it growing over time.
@@ -161,7 +161,8 @@ nk_d3d11_render(ID3D11DeviceContext *context, enum nk_anti_aliasing AA)
ID3D11DeviceContext_DrawIndexed(context, (UINT)cmd->elem_count, offset, 0);
offset += cmd->elem_count;
}
- nk_clear(&d3d11.ctx);}
+ nk_clear(&d3d11.ctx);
+ nk_buffer_clear(&d3d11.cmds);}
static void
@@ -190,6 +190,7 @@ nk_d3d9_render(enum nk_anti_aliasing AA)
nk_clear(&d3d9.ctx);
+ nk_buffer_clear(&d3d9.cmds);
IDirect3DStateBlock9_Apply(d3d9.state);
IDirect3DStateBlock9_Release(d3d9.state);
@@ -174,6 +174,7 @@ nk_glfw3_render(enum nk_anti_aliasing AA)
nk_clear(&glfw.ctx);
+ nk_buffer_clear(&dev->cmds);
nk_buffer_free(&vbuf);
nk_buffer_free(&ebuf);
@@ -295,6 +295,7 @@ nk_glfw3_render(enum nk_anti_aliasing AA, int max_vertex_buffer, int max_element
/* default OpenGL state */
@@ -446,6 +446,7 @@ nk_glfw3_render(enum nk_anti_aliasing AA)
glUseProgram(0);
@@ -154,6 +154,7 @@ nk_sdl_render(enum nk_anti_aliasing AA)
nk_clear(&sdl.ctx);
@@ -275,6 +275,7 @@ nk_sdl_render(enum nk_anti_aliasing AA, int max_vertex_buffer, int max_element_b
@@ -276,6 +276,7 @@ nk_sdl_render(enum nk_anti_aliasing AA, int max_vertex_buffer, int max_element_b
@@ -152,6 +152,7 @@ nk_sfml_render(enum nk_anti_aliasing AA)
nk_clear(&sfml.ctx);
@@ -279,6 +279,7 @@ nk_sfml_render(enum nk_anti_aliasing AA, int max_vertex_buffer, int max_element_
glBindBuffer(GL_ARRAY_BUFFER, 0);
@@ -184,6 +184,7 @@ nk_x11_render(enum nk_anti_aliasing AA, int max_vertex_buffer, int max_element_b
nk_clear(&x11.ctx);
@@ -566,6 +566,7 @@ nk_x11_render(enum nk_anti_aliasing AA, int max_vertex_buffer, int max_element_b
@@ -293,6 +293,7 @@ device_draw(struct device *dev, struct nk_context *ctx, int width, int height,
nk_clear(ctx);
@@ -717,6 +717,7 @@ device_draw(struct device *dev, struct nk_context *ctx, int width, int height,
@@ -747,6 +747,7 @@ device_draw(struct device *dev, struct nk_context *ctx, int width, int height,
@@ -317,6 +317,7 @@ device_draw(struct device *dev, struct nk_context *ctx, int width, int height,