hschumann2/TempleOS-Source-Code
0847
1 2#define PTS_NUM 163 4U0 BSplineDemo()5{6 CDC *dc=DCAlias;7 I64 arg1,arg2,i=0,msg_code;8 CD3I32 c[PTS_NUM];9 10 SettingsPush;11 Fs->win_inhibit=WIG_TASK_DFT-WIF_SELF_FOCUS-WIF_SELF_BORDER;12 13 DocClear;14 "Sel ctrl points with left mouse. Right when finished.\n";15 DCFill;16 do {17 msg_code=GetMsg(&arg1,&arg2,1<<MSG_MS_L_UP+1<<MSG_MS_R_UP);18 if (msg_code==MSG_MS_L_UP) {19 c[i].x=arg1; c[i].y=arg2; c[i].z=0;20 dc->color=GREEN;21 GrCircle(dc,arg1,arg2,10);22 i++;23 }24 } while (i<PTS_NUM && msg_code!=MSG_MS_R_UP);25 dc->color=RED;26 Gr2BSpline(dc,c,i,TRUE);27 dc->color=BLUE;28 Gr3BSpline(dc,c,i,TRUE);29 DCDel(dc);30 SettingsPop;31 32 PressAKey;33 DCFill;34}35 36BSplineDemo;37 