GDI+ split rendering GUI and clear surface

For example, I draw something via GDI+. Now I can call `nk_gdip_render_gui(AA)` and it will not erase my drawings, just will draw on top. 
Previos API was not changed.
This commit is contained in:
Dmitry Hrabrov 2017-02-04 18:24:49 +03:00 committed by GitHub
parent 4442697ee0
commit 35e8558be4

View File

@ -1040,7 +1040,7 @@ nk_gdip_shutdown(void)
} }
NK_API void NK_API void
nk_gdip_render(enum nk_anti_aliasing AA, struct nk_color clear) nk_gdip_render_gui(enum nk_anti_aliasing AA)
{ {
const struct nk_command *cmd; const struct nk_command *cmd;
@ -1048,7 +1048,6 @@ nk_gdip_render(enum nk_anti_aliasing AA, struct nk_color clear)
TextRenderingHintClearTypeGridFit : TextRenderingHintSingleBitPerPixelGridFit); TextRenderingHintClearTypeGridFit : TextRenderingHintSingleBitPerPixelGridFit);
GdipSetSmoothingMode(gdip.memory, AA != NK_ANTI_ALIASING_OFF ? GdipSetSmoothingMode(gdip.memory, AA != NK_ANTI_ALIASING_OFF ?
SmoothingModeHighQuality : SmoothingModeNone); SmoothingModeHighQuality : SmoothingModeNone);
nk_gdip_clear(clear);
nk_foreach(cmd, &gdip.ctx) nk_foreach(cmd, &gdip.ctx)
{ {
@ -1129,4 +1128,11 @@ nk_gdip_render(enum nk_anti_aliasing AA, struct nk_color clear)
nk_clear(&gdip.ctx); nk_clear(&gdip.ctx);
} }
NK_API void
nk_gdip_render(enum nk_anti_aliasing AA, struct nk_color clear)
{
nk_gdip_clear(clear);
nk_gdip_render_gui(AA);
}
#endif #endif