diff options
author | Hanspeter Portner <dev@open-music-kontrollers.ch> | 2017-09-01 19:27:21 +0200 |
---|---|---|
committer | Hanspeter Portner <dev@open-music-kontrollers.ch> | 2017-09-01 19:27:21 +0200 |
commit | d18112c39a19de09e74edd0eb16b0810a727c3a4 (patch) | |
tree | 412b5f0f251346c5b6f0d5b1dd7437bfbe8f8b78 | |
parent | 5afb7ffd0042f449e21a8016898c11a127547ab6 (diff) | |
download | sherlock.lv2-d18112c39a19de09e74edd0eb16b0810a727c3a4.tar.xz |
Squashed 'nk_pugl/' changes from 7709c91..fa04a9a
fa04a9a add missing API call definition.
b039df2 implement resize feature/extension.
git-subtree-dir: nk_pugl
git-subtree-split: fa04a9ab645b19eaee3033dfff26aa3faa1d5c43
-rw-r--r-- | nk_pugl.h | 23 |
1 files changed, 20 insertions, 3 deletions
@@ -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) { |