From 91b515d50fc1c53f91e4f1d24a889d3227bd638e Mon Sep 17 00:00:00 2001 From: Leonard Ritter Date: Tue, 9 Sep 2014 13:10:28 +0200 Subject: [PATCH] uiMakeCurrent no longer clears items --- oui.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/oui.h b/oui.h index 829fd1a..ec0a12a 100644 --- a/oui.h +++ b/oui.h @@ -747,13 +747,15 @@ static UIcontext *ui_context = NULL; UIcontext *uiCreateContext() { UIcontext *ctx = (UIcontext *)malloc(sizeof(UIcontext)); memset(ctx, 0, sizeof(UIcontext)); + UIcontext *oldctx = ui_context; + uiMakeCurrent(ctx); + uiClear(); + uiMakeCurrent(oldctx); return ctx; } void uiMakeCurrent(UIcontext *ctx) { ui_context = ctx; - if (ui_context) - uiClear(); } void uiDestroyContext(UIcontext *ctx) {