void einfache_flaeche_wc_3d(int c, vecp vr, vecp v0p, vecp v1p,vecp v2p,vecp v3p){ int i; static int handle, initialized=0, maxnum=1000, aktnum=-1; static Gobject *flaechen,*flaechentmp; if (!initialized) { handle=getview3dhandle(); flaechen=malloc(maxnum*sizeof(Gobject)); for (i=0;i<maxnum;i++) i_f(i) initialized=1; } if (newframe(handle)) aktnum=-1; if (++aktnum>=maxnum){ flaechentmp=malloc(2*maxnum*sizeof(Gobject)); for (i=0;i<maxnum;i++)flaechentmp[i]=flaechen[i]; free(flaechen); flaechen=flaechentmp; for (i=maxnum;i<maxnum*2;i++) i_f(i) maxnum*=2; } flaechen[aktnum].van=c; veq(flaechen[aktnum].poswc,vr); veq(flaechen[aktnum].tva[0],v0p); veq(flaechen[aktnum].tva[1],v1p); veq(flaechen[aktnum].tva[2],v2p); veq(flaechen[aktnum].tva[3],v3p); insertGobject(&(flaechen[aktnum])); }
int main(void) { volatile float x = 1.3; volatile double y = 2.5; volatile float z = 3.5; volatile double a = 4.5; v_f(x); v_f(z); v_d(y); v_d(a); v_ff(x, z); v_fd(x, y); v_df(a, x); v_dd(y, a); i_f(x); i_f(z); i_d(y); i_d(a); i_ff(x, z); i_fd(x, y); i_df(a, x); i_dd(y, a); }