Drawpoly

BlitzMax Forums/BlitzMax Beginners Area/Drawpoly

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.

Does anybody know how I can avoid the black corners on the my_poly image in this example but keep the shadeblend
SetGraphicsDriver GLMax2DDriver()
Graphics 800,600,0
image=LoadImage("max.png")
my_poly=CreateImage(100,100)
Local poly#[]=[0.0,50.0,50.0,0.0,100.0,0.0,100.0,50.0,100.0,100.0]
Cls
SetColor 255,0,0
DrawPoly poly
GrabImage (my_poly,0,0)
SetColor 255,255,255
While Not KeyHit(KEY_ESCAPE)
    Cls
    DrawImage image,100,100
	mx=MouseX() ; my=MouseY()
	SetBlend shadeblend
	SetAlpha 0.6
	DrawImage my_poly,mx,my
	SetBlend maskblend
	SetAlpha 1.0
	FlushMem
	Flip
Wend
End

<edit> It seems that Shadeblend turns off maskblend. That's annoying. Is there a way around it?
<edit2> OK, I got it. Edited glMAX2D...
		Case SHADEBLEND
			glEnable GL_BLEND
			glBlendFunc GL_DST_COLOR,GL_ZERO
			glEnable GL_ALPHA_TEST
			glAlphaFunc GL_GEQUAL,.5

Hope it doesn't cause any grief later.