static void getmove( /* get view change */ XButtonPressedEvent *ebut ) { int movdir = MOVDIR(ebut->button); int movorb = MOVORB(ebut->state); int oldnodesiz = qtMinNodesiz; Window rootw, childw; int rootx, rooty, wx, wy; unsigned int statemask; qtMinNodesiz = 24; /* accelerate update rate */ XNoOp(ourdisplay); while (!XCheckMaskEvent(ourdisplay, ButtonReleaseMask, levptr(XEvent))) { if (!XQueryPointer(ourdisplay, gwind, &rootw, &childw, &rootx, &rooty, &wx, &wy, &statemask)) break; /* on another screen */ if (!moveview(wx, odev.vres-1-wy, movdir, movorb)) { sleep(1); continue; } glClear(GL_COLOR_BUFFER_BIT); qtUpdate(); draw_grids(); glFlush(); } if (!(inpresflags & DFL(DC_SETVIEW))) { /* do final motion */ movdir = MOVDIR(levptr(XButtonReleasedEvent)->button); wx = levptr(XButtonReleasedEvent)->x; wy = levptr(XButtonReleasedEvent)->y; moveview(wx, odev.vres-1-wy, movdir, movorb); } dev_flush(); qtMinNodesiz = oldnodesiz; /* restore quadtree resolution */ }
void getmove( /* move camera */ char *s ) { FVECT vc; double mag; if (getinterest(s, 0, vc, &mag) < 0) return; moveview(0.0, 0.0, mag, vc); }
static void getmove( /* get view change */ XButtonPressedEvent *ebut ) { int movdir = MOVDIR(ebut->button); int movorb = MOVORB(ebut->state); int moved = 0; Window rootw, childw; int rootx, rooty, wx, wy; unsigned int statemask; copylastv( movorb ? (movdir ? "left/right" : "up/down") : (movdir ? "fore/back" : "rotate") ); XNoOp(ourdisplay); while (!XCheckMaskEvent(ourdisplay, ButtonReleaseMask, levptr(XEvent))) { /* pause so as not to move too fast */ waitabit(); if (!XQueryPointer(ourdisplay, gwind, &rootw, &childw, &rootx, &rooty, &wx, &wy, &statemask)) break; /* on another screen */ if (!moveview(wx, vres-1-wy, movdir, movorb)) { sleep(1); continue; } else moved++; } if (!moved) { /* do final motion */ movdir = MOVDIR(levptr(XButtonReleasedEvent)->button); wx = levptr(XButtonReleasedEvent)->x; wy = levptr(XButtonReleasedEvent)->y; moveview(wx, vres-1-wy, movdir, movorb); } }
void getpivot( /* pivot viewpoint */ char *s ) { FVECT vc; double angle, elev, mag; elev = 0.0; if (sscanf(s, "%lf %lf", &angle, &elev) < 1) { error(COMMAND, "missing angle"); return; } if (getinterest(sskip2(s,2), 0, vc, &mag) < 0) return; moveview(angle, elev, mag, vc); }