aboutsummaryrefslogtreecommitdiff
path: root/nk_pugl
diff options
context:
space:
mode:
authorHanspeter Portner <dev@open-music-kontrollers.ch>2016-12-21 20:47:02 +0100
committerHanspeter Portner <dev@open-music-kontrollers.ch>2016-12-21 20:47:02 +0100
commit308b99889a6b67398bb7cffebd0402b93b077310 (patch)
tree81f03dd235bc133352884d890ae823c77bef7fdf /nk_pugl
parent5fe5c73b0cfb51bcb3934c0a6f9d06dfcc6c5e96 (diff)
parenta4d9f48b17acb9cad3fa2d4ac79368e623865867 (diff)
downloadsynthpod-308b99889a6b67398bb7cffebd0402b93b077310.tar.xz
Merge commit 'a4d9f48b17acb9cad3fa2d4ac79368e623865867' into nk
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 0de714b6..d4ba3e51 100644
--- a/nk_pugl/nk_pugl.h
+++ b/nk_pugl/nk_pugl.h
@@ -101,6 +101,7 @@ struct _nk_pugl_window_t {
void *buffer;
size_t size;
} last;
+ bool was_left;
GLuint font_tex;
nkglGenerateMipmap glGenerateMipmap;
@@ -308,7 +309,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);
@@ -325,7 +326,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
@@ -715,14 +716,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;
}