DECLARE SUB DQBtri (BYVAL Layer, BYVAL x1, BYVAL y1, BYVAL x2, BYVAL y2,
BYVAL x3, BYVAL y3, BYVAL Col)
Layer - Layer where to draw the triangle
x1 - x coordinate of the first vertex
y1 - y coordinate of the first vertex
x2 - x coordinate of the second vertex
y2 - y coordinate of the second vertex
x3 - x coordinate of the third vertex
y3 - y coordinate of the third vertex
Col - color
none
Draws a flat-shaded triangle with (x1,y1), (x2,y2) and (x3,y3) as vertex, filled with specified color. DQBtri does not support transparency, but it's affected by the clipping box.
See also DQBgtri
*****************************************************************************
' All integers for speed
DEFINT A-Z
'$INCLUDE:'DIRECTQB.BI'
' Let's initialize the library with no extra layers nor sounds nor EMS
IF DQBinit(0, 0, 0) THEN DQBclose: PRINT DQBerror$: END
DQBinitVGA
' Draws 500 flat-shaded triangles
FOR i = 1 TO 500
DQBtri VIDEO, (RND * 320), (RND * 200), (RND * 320), (RND * 200), (RND * 320), (RND * 200), (RND * 256)
NEXT i
' Waits for the user to press a key
WHILE INKEY$ = "": WEND
' Ends program
DQBclose
*****************************************************************************