Recursive_render on SetWH
All checks were successful
pyrite-dev/milsko/pipeline/head This commit looks good
All checks were successful
pyrite-dev/milsko/pipeline/head This commit looks good
This commit is contained in:
parent
0606f398ae
commit
81b229c99a
3 changed files with 17 additions and 13 deletions
|
|
@ -108,14 +108,13 @@ static void mouse_move(MwWidget handle, void* user, void* call) {
|
|||
|
||||
int main() {
|
||||
MwSizeHints hints;
|
||||
MwWidget window, viewport;
|
||||
MwWidget window;
|
||||
|
||||
MwLibraryInit();
|
||||
|
||||
window = MwVaCreateWidget(MwWindowClass, "main", NULL, MwDEFAULT, MwDEFAULT, 640, 480,
|
||||
MwNtitle, "tripaint",
|
||||
NULL);
|
||||
viewport = MwCreateWidget(MwViewportClass, "viewport", window, 5, 5, 630, 470 - 16 - 5);
|
||||
window = MwVaCreateWidget(MwWindowClass, "main", NULL, MwDEFAULT, MwDEFAULT, 640, 480,
|
||||
MwNtitle, "tripaint",
|
||||
NULL);
|
||||
|
||||
hints.min_width = hints.max_width = 640;
|
||||
hints.min_height = hints.max_height = 480;
|
||||
|
|
@ -125,13 +124,12 @@ int main() {
|
|||
MwNtext, "Press left click to draw triangle, right click to undo",
|
||||
NULL);
|
||||
|
||||
MwViewportSetSize(viewport, 1024, 768);
|
||||
|
||||
t = malloc(sizeof(*t));
|
||||
|
||||
opengl = MwCreateWidget(MwOpenGLClass, "opengl", MwViewportGetViewport(viewport), 0, 0, 1024, 768);
|
||||
opengl = MwCreateWidget(MwOpenGLClass, "opengl", window, 0, 0, 640, 460);
|
||||
|
||||
MwAddUserHandler(window, MwNtickHandler, tick, NULL);
|
||||
MwAddUserHandler(opengl, MwNtickHandler, tick, NULL);
|
||||
MwAddUserHandler(opengl, MwNmouseDownHandler, mouse, NULL);
|
||||
MwAddUserHandler(opengl, MwNmouseMoveHandler, mouse_move, NULL);
|
||||
|
||||
|
|
|
|||
|
|
@ -1720,6 +1720,7 @@ static void clip(MwLL handle) {
|
|||
int w, h, x, y, cx, cy;
|
||||
MwLL toplevel = handle->wayland.parent;
|
||||
MwLL* ws = NULL;
|
||||
return;
|
||||
|
||||
arrput(ws, handle);
|
||||
while(toplevel) {
|
||||
|
|
@ -1868,7 +1869,7 @@ static MwLL MwLLCreateImpl(MwLL parent, int x, int y, int width, int height) {
|
|||
}
|
||||
#endif
|
||||
|
||||
if(parent != NULL){
|
||||
if(parent != NULL) {
|
||||
arrput(parent->wayland.children, r);
|
||||
}
|
||||
|
||||
|
|
@ -1949,9 +1950,9 @@ static void MwLLDestroyImpl(MwLL handle) {
|
|||
|
||||
wl_flush(handle);
|
||||
|
||||
if(handle->wayland.parent != NULL){
|
||||
for(i = 0; i < arrlen(handle->wayland.parent->wayland.children); i++){
|
||||
if(handle->wayland.parent->wayland.children[i] == handle){
|
||||
if(handle->wayland.parent != NULL) {
|
||||
for(i = 0; i < arrlen(handle->wayland.parent->wayland.children); i++) {
|
||||
if(handle->wayland.parent->wayland.children[i] == handle) {
|
||||
arrdel(handle->wayland.parent->wayland.children, i);
|
||||
break;
|
||||
}
|
||||
|
|
@ -1974,7 +1975,7 @@ static void MwLLGetXYWHImpl(MwLL handle, int* x, int* y, unsigned int* w, unsign
|
|||
*h = handle->wayland.wh;
|
||||
}
|
||||
|
||||
static void recursive_render(MwLL handle){
|
||||
static void recursive_render(MwLL handle) {
|
||||
int i;
|
||||
|
||||
for(i = 0; i < arrlen(handle->wayland.children); i++) recursive_render(handle->wayland.children[i]);
|
||||
|
|
@ -2030,6 +2031,9 @@ static void MwLLSetWHImpl(MwLL handle, int w, int h) {
|
|||
framebuffer_setup(&handle->wayland);
|
||||
backbuffer_destroy(&handle->wayland);
|
||||
backbuffer_setup(&handle->wayland);
|
||||
|
||||
recursive_render(handle);
|
||||
|
||||
MwLLDispatch(handle, draw, NULL);
|
||||
handle->wayland.events_pending = 1;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -431,6 +431,8 @@ static void mwOpenGLMakeCurrentImpl(MwWidget handle) {
|
|||
o->egl_context)) {
|
||||
printf("ERROR: eglMakeCurrent, %0X\n", eglGetError());
|
||||
}
|
||||
|
||||
MwLLForceRender(handle->lowlevel);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue