Code: Select all
Vect2D_s16 * pts;
u16 palette[16];
int main()
{
MEM_free(pts);
palette[0] = RGB24_TO_VDPCOLOR(0x000000);
palette[1] = RGB24_TO_VDPCOLOR(0x0000FF);
palette[2] = RGB24_TO_VDPCOLOR(0x00FF00);
palette[3] = RGB24_TO_VDPCOLOR(0xFF0000);
palette[4] = RGB24_TO_VDPCOLOR(0x00FFFF);
palette[5] = RGB24_TO_VDPCOLOR(0xFFFF00);
palette[6] = RGB24_TO_VDPCOLOR(0xFF00FF);
palette[7] = RGB24_TO_VDPCOLOR(0xFFFFFF);
palette[8] = RGB24_TO_VDPCOLOR(0x404040);
palette[9] = RGB24_TO_VDPCOLOR(0x000080);
palette[10] = RGB24_TO_VDPCOLOR(0x008000);
palette[11] = RGB24_TO_VDPCOLOR(0x800000);
palette[12] = RGB24_TO_VDPCOLOR(0x008080);
palette[13] = RGB24_TO_VDPCOLOR(0x808000);
palette[14] = RGB24_TO_VDPCOLOR(0x800080);
palette[15] = RGB24_TO_VDPCOLOR(0x808080);
VDP_setPalette(PAL1, palette);
VDP_setScreenWidth320();
SYS_enableInts();
VDP_clearPlane(BG_A, TRUE);
BMP_init(TRUE, BG_A, PAL1, FALSE);
BMP_setBufferCopy(TRUE);
while(TRUE)
{
handleInput();
pts[0].x =10;
pts[0].y =10;
pts[1].x =40;
pts[1].y = 10;
pts[2].x =40;
pts[2].y = 40;
pts[3].x =10;
pts[3].y = 40;
BMP_drawPolygon (pts,3,5);
BMP_flip(FALSE);
}
return 0;
}
![Image](https://i2.paste.pics/bf8730a60d0635a986819993a6b20650.png)