Can someone tell me why this is sooooo slow?

BlitzMax Forums/BlitzMax Programming/Can someone tell me why this is sooooo slow?

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.

Function DoIris()
	Local x = 200,y = 150,d = 1000
	Local center_x = 400,center_y = 300

	Local circle:TImage = CreateImage(800,600,1,MASKEDIMAGE | DYNAMICIMAGE)
	GrabImage(circle,0,0)

	Repeat
		d = 1000
		Repeat
			Cls
			
			SetColor(255,0,255)		' The mask color
			
			x = center_x - (d / 2)	' Convert from silly 'circle in box' to more conventional circle center
			y = center_y - (d / 2)
			
			DrawOval(x,y,d,d)		' Draw the circle on the back buffer
			d:- 5
			
			GrabImage(circle,0,0)	' And then copy it to circle:Timage
			
'			DrawLevel()				' Now, draw the game level (This is NOT the bottle neck here...)

			SetColor(255,255,255)	' Since current color affects drawing operations...
			DrawImage(circle,0,0)	' Now draw the circle image we created on top of the level so it will show through
			
'			Delay(30)

			Flip					' Show what we've got
		Until d <= 10				' Loop again when we've got a really small circle
	Forever
End Function

Let it run for half a minute or so and it will bring your entire system to a screeching halt (even after you stop it), requiring a restart.

Also, since the mask color is 255,0,255 (same as the color of the circle), shouldn't it show the items behind it through?

What am I missing here?

Thanks,
Russell

p.s. Even with DrawLevel() and Delay() commented out, it still crawls...