swap buffers in draw handler instead
This commit is contained in:
parent
495ea93c74
commit
39533b3fec
6 changed files with 45 additions and 32 deletions
10
src/core.c
10
src/core.c
|
|
@ -7,6 +7,7 @@
|
|||
|
||||
static void lldrawhandler(MwLL handle, void* data) {
|
||||
MwWidget h = (MwWidget)handle->common.user;
|
||||
int ind;
|
||||
|
||||
(void)data;
|
||||
|
||||
|
|
@ -14,6 +15,13 @@ static void lldrawhandler(MwLL handle, void* data) {
|
|||
MwDispatch(h, draw);
|
||||
if(h->draw_inject != NULL) h->draw_inject(h);
|
||||
MwDispatchUserHandler(h, MwNdrawHandler, NULL);
|
||||
|
||||
handle->common.do_redraw = MwTRUE;
|
||||
if(h->parent == NULL) {
|
||||
MwLLEndDraw(h->lowlevel);
|
||||
} else if(h->parent->lowlevel == NULL) {
|
||||
MwLLEndDraw(h->lowlevel);
|
||||
}
|
||||
}
|
||||
|
||||
static void lluphandler(MwLL handle, void* data) {
|
||||
|
|
@ -334,8 +342,6 @@ void MwLoop(MwWidget handle) {
|
|||
}
|
||||
if(v != 0) break;
|
||||
|
||||
MwLLEndDraw(handle->lowlevel);
|
||||
|
||||
for(i = 0; i < arrlen(handle->tick_list); i++) {
|
||||
MwDispatch(handle->tick_list[i], tick);
|
||||
MwDispatchUserHandler(handle->tick_list[i], MwNtickHandler, NULL);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue