U0 BSplineDemo() { CDC *dc=DCAlias; I64 p1,p2,i=0,msg_code; CD3I32 c[64]; SettingsPush; Fs->win_inhibit=WIF_ALL-WIF_BORDER; DocClear; "Select ctrl points with left mouse.Right when finished.\n"; DCFill; do { msg_code=GetMsg(&p1,&p2,1<<MSG_IP_L_UP+1<<MSG_IP_R_UP); if (msg_code==MSG_IP_L_UP) { c[i].x=p1; c[i].y=p2; c[i].z=0; dc->color=GREEN; GrCircle(dc,p1,p2,10); i++; } } while (msg_code!=MSG_IP_R_UP); dc->color=RED; Gr2BSpline(dc,c,i,TRUE); dc->color=BLUE; Gr3BSpline(dc,c,i,TRUE); DCDel(dc); SettingsPop; PressAKey; DCFill; }
U0 DrawIt(CTask *,CDC *dc) { F64 é=0,dt=tMBeat-t0; I64 x=100.0*Cos(dt*2*ã/8.0),y=30.0*Sin(-dt*2*ã/8.0); dc->color=BLACK; GrCircle(dc,SUN_X,SUN_Y,10); dc->color=YELLOW; GrFloodFill(dc,SUN_X,SUN_Y,FALSE); if (dt>16) é=(dt-16)*2*ã; SpritePlotRotZ3b(dc,x+SUN_X-32,y+SUN_Y,0,$IB,"<1>",1$,é); }
U0 DrawIt(CTask *task,CDC *dc) { Bool old_suspend; MyMass *tempm; MySpring *temps; old_suspend=Suspend(task); dc->color=RED; temps=ode->next_spring; while (temps!=&ode->next_spring) { GrLine(dc,temps->end1->x,temps->end1->y, temps->end2->x,temps->end2->y); temps=temps->next; } dc->color=BLACK; tempm=ode->next_mass; while (tempm!=&ode->next_mass) { GrCircle(dc,tempm->x,tempm->y,tempm->radius); tempm=tempm->next; } Suspend(task,old_suspend); }
/* Draw a circle with color c. */ void ws_drawcircle(int x, int y, int r, int c, int xor) { GrCircle( x, y, r, c | (xor ? GrXOR : 0) ); }