Request features for a retro 2d lib.

BlitzMax Forums/BlitzMax Programming/Request features for a retro 2d lib.

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

This is a bit quicker...
Graphics 320,240
Local lx,ly
Local frames,lf,fps
mypixmap:TPixmap=CreatePixmap(320,240,PF_RGBA8888)
Repeat
Cls
	For Local x=0 Until 320
	For Local y=0 Until 240
		Local xd,yd
		xd = x-lx
		yd = y-yd
		Local mag = Sqr(xd*Xd+Yd*Yd)
		mag = 255-mag
		If mag<0 mag=0
		If mag>255 mag=255
'		SetColor mag,mag,mag
        argb=$ff Shl 24 | mag Shl 16 | mag Shl 8 | mag Shl 0
		WritePixel mypixmap,x,y,argb
	Next
	Next
'       drawpixmap mypixmap,0,0
	DrawImage LoadImage(mypixmap),0,0
	If MilliSecs()>lf
		lf = MilliSecs()+1000
		fps=frames
		frames=0
		Print "Fps:"+fps
	EndIf
	frames:+1
	
Flip
Forever

Drawpixmap is slightly quicker than the drawimage version.