> compile NEMU
221220000 张三 Linux zzy 5.15.146.1-microsoft-standard-WSL2 #1 SMP Thu Jan 11 04:09:03 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux 20:16:09 up 7 days, 20:16, 1 user, load average: 0.23, 0.25, 0.22
This commit is contained in:
@ -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);
|
||||
|
Reference in New Issue
Block a user