Files
TempleOS-Rijn/LT/Demo/Graphics/Sprite2.CPZ
T
2018-09-08 21:45:20 +02:00

55 lines
1.2 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
//$FG,2$This demo uses $FG,4$grbase2$FG,2$, so you must add a$FG$
//$FG,4$update_win$FG,2$ routine because $FG,4$grbase2$FG,2$ is not$FG$
//persistent. (It gets erased each update by
//the system.)
$PI,"<PI 2>",2$
GrBitMap *base=GrAlias(grbase2,Fs);
void DrawIt(TssStruct *tss)
{
//Without this, the text of other windows below
//would appear.
ClearWinText(tss);
//$FG,2$We can change the pen width because it was not$FG$
//$FG,2$define in $FG,4$CTRL-R$FG,2$.$FG$
base->pen_width=2;
base->bkcolor=BLACK;
GrElemsPlot(base,0,0,0,$IB,"<IB 2>",2$);
}
void Sprite2()
{
double theta=0,phi=0;
I8 *r1,*r2,*temp;
void *old_update=Fs->update_win;
Fs->update_win=&DrawIt;
base->x=200;
base->y=200;
base->flags|=BMF_TRANSFORMATION;
while (!ScanKey) {
r1=GrTheta(theta);
r2=GrPhi(phi);
temp=base->r;
base->r=GrMulMat(r1,r2);
Free(temp);
Free(r1);
Free(r2);
Sleep(40);
theta+=pi2/100;
phi +=pi2/130;
}
Fs->update_win=old_update;
}
Sprite2;‚#øÿÿÿ#øÿÿÿ1 1 ""*"