aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHanspeter Portner <dev@open-music-kontrollers.ch>2017-09-01 19:27:25 +0200
committerHanspeter Portner <dev@open-music-kontrollers.ch>2017-09-01 19:27:25 +0200
commita55713ba3cca90d3ea2e474e1a7310ecece1f557 (patch)
tree3daa339693c92efccb10cbd5cb614787c7f79017
parentb3c50a36e9c96229915627d2729aebd7ddd1a28b (diff)
parentd18112c39a19de09e74edd0eb16b0810a727c3a4 (diff)
downloadsherlock.lv2-a55713ba3cca90d3ea2e474e1a7310ecece1f557.tar.xz
Merge commit 'd18112c39a19de09e74edd0eb16b0810a727c3a4'
-rw-r--r--nk_pugl/nk_pugl.h23
1 files changed, 20 insertions, 3 deletions
diff --git a/nk_pugl/nk_pugl.h b/nk_pugl/nk_pugl.h
index eb6f041..d20752c 100644
--- a/nk_pugl/nk_pugl.h
+++ b/nk_pugl/nk_pugl.h
@@ -139,6 +139,9 @@ nk_pugl_wait_for_event(nk_pugl_window_t *win);
NK_PUGL_API int
nk_pugl_process_events(nk_pugl_window_t *win);
+NK_PUGL_API int
+nk_pugl_resize(nk_pugl_window_t *win, int width, int height);
+
NK_PUGL_API void
nk_pugl_post_redisplay(nk_pugl_window_t *win);
@@ -447,7 +450,7 @@ _nk_pugl_font_deinit(nk_pugl_window_t *win)
}
static void
-_nk_pugl_resize(nk_pugl_window_t *win)
+_nk_pugl_host_resize(nk_pugl_window_t *win)
{
nk_pugl_config_t *cfg = &win->cfg;
@@ -470,7 +473,7 @@ _nk_pugl_reconfigure(nk_pugl_window_t *win)
#if 0
if(win->cfg.resizable)
- _nk_pugl_resize(win);
+ _nk_pugl_host_resize(win);
#endif
}
@@ -1068,7 +1071,7 @@ nk_pugl_show(nk_pugl_window_t *win)
return;
puglShowWindow(win->view);
- _nk_pugl_resize(win);
+ _nk_pugl_host_resize(win);
}
NK_PUGL_API void
@@ -1136,6 +1139,20 @@ nk_pugl_process_events(nk_pugl_window_t *win)
return win->quit;
}
+NK_PUGL_API int
+nk_pugl_resize(nk_pugl_window_t *win, int width, int height)
+{
+ if(!win->view)
+ return 1; // quit
+
+ win->cfg.width = width;
+ win->cfg.height = height;
+
+ puglPostRedisplay(win->view);
+
+ return 0;
+}
+
NK_PUGL_API void
nk_pugl_post_redisplay(nk_pugl_window_t *win)
{