return 1;
}
erb_set_done_callback(erb, jobdone, 0);
+
reshape_pending = redisp_pending = 1;
glGenTextures(1, &fbtex);
break;
}
- redisp_pending = 0;
- glutMainLoopEvent();
-
if(FD_ISSET(pfd[0], &rdset)) {
struct erb_rect rect;
read(pfd[0], &rect, sizeof rect);
glTexSubImage2D(GL_TEXTURE_2D, 0, rect.x, rect.y, rect.w, rect.h,
GL_RGBA, GL_FLOAT, erb_getframe(erb) + (rect.y * win_width + rect.x) * 4);
post_redisplay();
- printf("update (%d %d %dx%d)!\n", rect.x, rect.y, rect.w, rect.h);
+ }
+
+ if(FD_ISSET(xfd, &rdset) || redisp_pending) {
+ redisp_pending = 0;
+ glutMainLoopEvent();
}
}
#endif /* __unix__ */
static void jobdone(unsigned int job, struct erb_rect *rect, void *cls)
{
- printf("jobdone!\n");
write(pfd[1], rect, sizeof *rect);
}