Non-fill Draw Shapes

BlitzMax Forums/BlitzMax Beginners Area/Non-fill Draw Shapes

I would go for something like this but adjust it to draw a standard rect.
<edit> Something like this (untested)
Function Drawrect1( x:Float, y:Float, w:Float,h:Float, fill:Int=True)
	Local origin_x:Float
	Local origin_y:Float
	GetOrigin origin_x,origin_y
	Local handle_x:Float
	Local handle_y:Float
	GetHandle handle_x,handle_y
	Local xy:Float[]=[x,y,x+w,y,x+w,y+h,x,y+h]
	If fill
		_max2dDriver.DrawPoly xy,..
		handle_x,handle_y,..
		x+origin_x,y+origin_y
	Else
		Local x1:Float=xy[xy.Length-2]
		Local y1:Float=xy[xy.Length-1]
		For Local i:Int=0 Until Len xy Step 2
			Local x2:Float=xy[i]
			Local y2:Float=xy[i+1]
			_max2dDriver.DrawLine..
			handle_x+x1,handle_y+y1,..
			handle_x+x2,handle_y+y2,..
			x+origin_x-0.5,y+origin_y-0.5
			x1=x2
			y1=y2
		Next

	EndIf
End Function
Graphics 800 , 600
drawrect1(100 , 100 , 100 , 100)
drawrect1(10,10,110,110,False)
Flip
WaitKey()