Skip to content

Commit

Permalink
fix GL screen refresh (but more CPU used)
Browse files Browse the repository at this point in the history
  • Loading branch information
JP Cimalando committed May 4, 2017
1 parent 95cb473 commit 42f4fdd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions examples/ui-gl-nanovg.cc
Expand Up @@ -82,12 +82,12 @@ bool UI::idle() {
if (!vg)
return false;

puglEnterContext(view);
if (P->needs_redraw) {
puglEnterContext(view);
P->draw_nvg();
puglLeaveContext(view, true);
P->needs_redraw = false;
}
puglLeaveContext(view, true);
return true;
}

Expand Down
4 changes: 2 additions & 2 deletions sources/ui.cc
Expand Up @@ -82,12 +82,12 @@ bool UI::idle() {
if (!vg)
return false;

puglEnterContext(view);
if (P->needs_redraw) {
puglEnterContext(view);
P->draw_nvg();
puglLeaveContext(view, true);
P->needs_redraw = false;
}
puglLeaveContext(view, true);
return true;
}

Expand Down

0 comments on commit 42f4fdd

Please sign in to comment.