diff --git a/navy-apps/libs/libndl/NDL.c b/navy-apps/libs/libndl/NDL.c index 3fc5718..0ac6435 100644 --- a/navy-apps/libs/libndl/NDL.c +++ b/navy-apps/libs/libndl/NDL.c @@ -54,23 +54,23 @@ static void _get_screen(int *w, int *h) { } void NDL_OpenCanvas(int *w, int *h) { - // if (getenv("NWM_APP")) { - // int fbctl = 4; - // fbdev = 5; - // screen_w = *w; screen_h = *h; - // char buf[64]; - // int len = sprintf(buf, "%d %d", screen_w, screen_h); - // // let NWM resize the window and create the frame buffer - // write(fbctl, buf, len); - // while (1) { - // // 3 = evtdev - // int nread = read(3, buf, sizeof(buf) - 1); - // if (nread <= 0) continue; - // buf[nread] = '\0'; - // if (strcmp(buf, "mmap ok") == 0) break; - // } - // close(fbctl); - // } + if (getenv("NWM_APP")) { + int fbctl = 4; + fbdev = 5; + screen_w = *w; screen_h = *h; + char buf[64]; + int len = sprintf(buf, "%d %d", screen_w, screen_h); + // let NWM resize the window and create the frame buffer + write(fbctl, buf, len); + while (1) { + // 3 = evtdev + int nread = read(3, buf, sizeof(buf) - 1); + if (nread <= 0) continue; + buf[nread] = '\0'; + if (strcmp(buf, "mmap ok") == 0) break; + } + close(fbctl); + } int dev_w, dev_h; _get_screen(&dev_w, &dev_h);