Files
TempleOS-Rijn/Demo/Graphics/SpritePlot3D.HC
T
2018-09-08 21:47:50 +02:00

56 lines
952 B
HolyC

/*This uses $LK,"gr.dc2",A="MN:CGrGlbls"$. It must be redrawn 30 fps
by the winmgr task with a Fs->draw_it() callback.
*/
$SP,"<1>",BI=1$
CDC *dc;
U0 DrawIt(CTask *,CDC *)
{
DCDepthBufRst(dc);
Sprite3(dc,0,0,0,$IB,"<1>",BI=1$);
}
U0 SpritePlot3D()
{
F64 é=0,è=0;
dc=DCAlias(gr.dc2,Fs);
SettingsPush; //See $LK,"SettingsPush",A="MN:SettingsPush"$
Fs->draw_it=&DrawIt;
dc->x=200;
dc->y=200;
dc->z=GR_Z_ALL;
dc->flags|=DCF_TRANSFORMATION;
DCDepthBufAlloc(dc);
while (!ScanChar) {
Mat4x4IdentEqu(dc->r);
Mat4x4RotX(dc->r,è);
Mat4x4RotZ(dc->r,é);
DCMat4x4Set(dc,dc->r);
Sleep(40);
é+=2*ã/100;
è+=2*ã/130;
}
SettingsPop;
DCDel(dc);
}
SpritePlot3D;
ÒÎÿÿÿÎÿÿÿ2Îÿÿÿ22Îÿÿÿ2ÎÿÿÿÎÿÿÿ222