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();
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();