away from sprites i saw it needs this when creating my last 2d-game
' -------------------------------------------------------------------------
Sub TexturedRect(ByVal TexID As Long, _
ByVal X As Long, _
ByVal Y As Long, _
ByVal width As Long, _
ByVal height As Long )
' -------------------------------------------------------------------------
'[?] If width < 1 Or height < 1 Then Exit Sub Or draw into other direction...
'[?] width -= 1 (X1, X2 thinkeable too)
'[?] height -= 1 (Y1, Y2...)
' function could have an optional parameter telling if width or X2 is meant
' or 2 Functions: "TexRectPos, TexRectSize"
' or stick to pos and user always has to pass "pos+size-1" if needed
TBGL_PushState %TBGL_TEXTURING
TBGL_BindTexture(TexID)
TBGL_BeginPoly %GL_QUADS
TBGL_TexCoord2D 0, 0
TBGL_Vertex X, Y + height
TBGL_TexCoord2D 1, 0
TBGL_Vertex X + width, Y + height
TBGL_TexCoord2D 1, 1
TBGL_Vertex X + width, Y
TBGL_TexCoord2D 0, 1
TBGL_Vertex X, Y
TBGL_EndPoly
TBGL_PopState
End Sub
Probably could be a default-textures-function to simply draw it 2D at given coords in given size
Bookmarks