diff options
author | Hanspeter Portner <dev@open-music-kontrollers.ch> | 2020-05-15 12:04:11 +0200 |
---|---|---|
committer | Hanspeter Portner <dev@open-music-kontrollers.ch> | 2020-05-15 12:04:11 +0200 |
commit | 574fc8cf826fc80824f475404523ddf418258568 (patch) | |
tree | 0a453500592fe166ceb16f411d878f88475813ff | |
parent | 4c8a4217f96607419792bda06f39e7f57bbeb1cd (diff) | |
parent | 43c7a842f791027f6cf82a3e35952fba86978cab (diff) | |
download | patchmatrix-574fc8cf826fc80824f475404523ddf418258568.tar.xz |
Merge commit '43c7a842f791027f6cf82a3e35952fba86978cab'
-rw-r--r-- | subprojects/nk_pugl/VERSION | 2 | ||||
-rw-r--r-- | subprojects/nk_pugl/nk_pugl/nk_pugl.h | 63 |
2 files changed, 12 insertions, 53 deletions
diff --git a/subprojects/nk_pugl/VERSION b/subprojects/nk_pugl/VERSION index eac5392..3170382 100644 --- a/subprojects/nk_pugl/VERSION +++ b/subprojects/nk_pugl/VERSION @@ -1 +1 @@ -0.1.139 +0.1.143 diff --git a/subprojects/nk_pugl/nk_pugl/nk_pugl.h b/subprojects/nk_pugl/nk_pugl/nk_pugl.h index 46c425e..11aeba0 100644 --- a/subprojects/nk_pugl/nk_pugl/nk_pugl.h +++ b/subprojects/nk_pugl/nk_pugl/nk_pugl.h @@ -428,10 +428,8 @@ _nk_pugl_render_gl2(nk_pugl_window_t *win) } static void -_nk_pugl_font_init(nk_pugl_window_t *win) +_nk_pugl_glew_init() { - nk_pugl_config_t *cfg = &win->cfg; - #if defined(__APPLE__) //FIXME #else @@ -443,6 +441,12 @@ _nk_pugl_font_init(nk_pugl_window_t *win) return; } #endif +} + +static void +_nk_pugl_font_init(nk_pugl_window_t *win) +{ + nk_pugl_config_t *cfg = &win->cfg; const int font_size = cfg->font.size * win->scale; @@ -520,32 +524,6 @@ _nk_pugl_host_resize(nk_pugl_window_t *win) } static void -_nk_pugl_reconfigure(nk_pugl_window_t *win) -{ - _nk_pugl_font_deinit(win); - _nk_pugl_font_init(win); -} - -static void -_nk_pugl_zoom_in(nk_pugl_window_t *win) -{ - win->scale += 0.1; - - _nk_pugl_reconfigure(win); -} - -static void -_nk_pugl_zoom_out(nk_pugl_window_t *win) -{ - if(win->scale >= 0.6) - { - win->scale -= 0.1; - - _nk_pugl_reconfigure(win); - } -} - -static void _nk_pugl_key_press(struct nk_context *ctx, enum nk_keys key) { nk_input_key(ctx, key, nk_true); @@ -695,14 +673,6 @@ _nk_pugl_key_down(nk_pugl_window_t *win, const PuglEventKey *ev) { switch(ev->key) { - case KEY_PLUS: - { - _nk_pugl_zoom_in(win); - } break; - case KEY_MINUS: - { - _nk_pugl_zoom_out(win); - } break; case KEY_C: { _nk_pugl_key_press(ctx, NK_KEY_COPY); @@ -869,21 +839,7 @@ _nk_pugl_event_func(PuglView *view, const PuglEvent *e) const PuglEventScroll *ev = (const PuglEventScroll *)e; _nk_pugl_modifiers(win, ev->state); - if(win->state & PUGL_MOD_CTRL) - { - if(ev->dy > 0) - { - _nk_pugl_zoom_in(win); - } - else - { - _nk_pugl_zoom_out(win); - } - } - else - { - nk_input_scroll(ctx, nk_vec2(0.f, ev->dy)); - } + nk_input_scroll(ctx, nk_vec2(0.f, ev->dy)); puglPostRedisplay(win->view); } break; @@ -929,6 +885,9 @@ _nk_pugl_event_func(PuglView *view, const PuglEvent *e) case PUGL_CREATE: { + // init glew + _nk_pugl_glew_init(); + // init font system _nk_pugl_font_init(win); |