aboutsummaryrefslogtreecommitdiff
path: root/nk_pugl
diff options
context:
space:
mode:
authorHanspeter Portner <dev@open-music-kontrollers.ch>2016-12-21 20:49:06 +0100
committerHanspeter Portner <dev@open-music-kontrollers.ch>2016-12-21 20:49:06 +0100
commit7e2c978c94bc2e23edffa5a4dc45f8da838e3439 (patch)
tree0084e3e6148f0497b26e1160cc02f71724b9e2e9 /nk_pugl
parent0b018069a0d48090ce4d3a7c2b8ccc74090ffe3e (diff)
parenta4d9f48b17acb9cad3fa2d4ac79368e623865867 (diff)
downloadsherlock.lv2-7e2c978c94bc2e23edffa5a4dc45f8da838e3439.tar.xz
Merge commit 'a4d9f48b17acb9cad3fa2d4ac79368e623865867'
Diffstat (limited to 'nk_pugl')
-rw-r--r--nk_pugl/nk_pugl.h18
1 files changed, 12 insertions, 6 deletions
diff --git a/nk_pugl/nk_pugl.h b/nk_pugl/nk_pugl.h
index 4976f8c..d7acd39 100644
--- a/nk_pugl/nk_pugl.h
+++ b/nk_pugl/nk_pugl.h
@@ -97,6 +97,7 @@ struct _nk_pugl_window_t {
void *buffer;
size_t size;
} last;
+ bool was_left;
GLuint font_tex;
nkglGenerateMipmap glGenerateMipmap;
@@ -300,7 +301,7 @@ _nk_pugl_render_gl2(nk_pugl_window_t *win)
const size_t size = win->ctx.memory.allocated;
const void *commands = nk_buffer_memory_const(&win->ctx.memory);
- if( (size != win->last.size) || memcmp(commands, win->last.buffer, size))
+ if( (size != win->last.size) || memcmp(commands, win->last.buffer, size) )
{
// swap last buffer with current one for next comparison
win->last.buffer = realloc(win->last.buffer, size);
@@ -317,7 +318,7 @@ _nk_pugl_render_gl2(nk_pugl_window_t *win)
}
// only render if there were actually any changes
- if(has_changes)
+ if(has_changes || win->was_left)
#endif
{
// convert shapes into vertexes if there were changes
@@ -707,14 +708,19 @@ _nk_pugl_event_func(PuglView *view, const PuglEvent *e)
puglPostRedisplay(win->view);
break;
}
- case PUGL_ENTER_NOTIFY:
- // fall-through
case PUGL_LEAVE_NOTIFY:
// fall-through
- case PUGL_FOCUS_IN:
- // fall-through
case PUGL_FOCUS_OUT:
{
+ win->was_left = true;
+ puglPostRedisplay(win->view);
+ break;
+ }
+ case PUGL_ENTER_NOTIFY:
+ // fall-through
+ case PUGL_FOCUS_IN:
+ {
+ win->was_left = false;
puglPostRedisplay(win->view);
break;
}