This example shows how to draw bordered and non bordered figures. Then it uses rotated figures in a simple animation. It has been used to generate the third image of the documentation.
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <math.h>
int points[] = {500, 300, 470, 250, 520, 255, 560, 280, 555, 320, 535, 345, 480, 340};
int main()
{
int scr;
int angles[5] = {0};
if ((scr =
mgsCreateScreen(800, 600,
"Animating figures", 0xFFC0C0, NULL)) < 0)
exit(EXIT_FAILURE);
mgsStarCR(scr, 5, 700, 90, 70, 30, MGS_CBLUE);
puts("Press A to animate");
puts("Press S to exit");
angles[0] += 2;
angles[1] -= 2;
angles[2] -= 2;
angles[3] += 2;
angles[4] += 1;
}
}