GLBasic User Manual

Main sections


STARTPOLY spriteID%, bMode%=0

The POLY command set is the mightiest from the SPRITE family, with them you can draw any polygon shape. Colour values can also be set for each polygon's corner.
There have to be at least 3 POLYVECTOR calls in-between STARTPOLY and ENDPOLY otherwise no area has been specified and nothing will be seen.
Between STARTPOLY and ENDPOLY no calls to DRAWSPRITE or PRINT functions are allowed. If you use DRAWSPRITE or print functions, non expected results or system crashes may occur!

-spriteID% is a ID of a bitmap loaded with LOADSPRITE
-1 means no texture (=bitmap) will be used. -> Only coloured polygons.
-iMode advises GLBasic to draw either a triangle fan (0), single triangles (1) or triangle strip (2). See POLYVECTOR for the layout.


LOADSPRITE "Block.bmp", 0 // 64x64 Bitmap
LOADBMP "Test.bmp"
STARTPOLY 0 // Bitmap = No.0
POLYVECTOR 0, 0, 0, 0, RGB(255, 255, 255)
POLYVECTOR 0, 300, 0, 64, RGB (255, 255, 255)
POLYVECTOR 300, 300, 64, 64, RGB(255, 255, 255)
POLYVECTOR 250, 50, 64, 0, RGB( 0, 255, 0)

See also...