GLDrawRect improvement

BlitzMax Forums/BlitzMax Module Tweaks/GLDrawRect improvement

JoshK(Posted 2007) [#1]
For convenience, I think GLDrawRect() should include texcoords:
Function GLDrawRect( x,y,width,height )
	BeginOrtho
	glBegin GL_QUADS
	glTexCoord2f 0.0,0.0
	glVertex2i x,y
	glTexCoord2f 1.0,0.0
	glVertex2i x+width,y
	glTexCoord2f 1.0,1.0
	glVertex2i x+width,y+height
	glTexCoord2f 0.0,1.0
	glVertex2i x,y+height
	glEnd
	EndOrtho
End Function



ImaginaryHuman(Posted 2007) [#2]
This would only be helpful if the programmer was also intending to switch on texturing and choose a texture. Presumably they could not rely on the previously drawn TImage as being the current texture, or that texturing is still active. If they are going to be dealing with setting those things themselves, surely it is not a big deal to write your own textured rect routine. And if you want this modified in Max2D, how is there any facility present in Max2D to select which texture is being used and to switch it on/off? This is only a partial implementation. If it's going to be standard they'll have to also provide `select texture` and `switch on/off texturing` functions.