#include "raylib.h"
#define WIDTH 800
#define HEIGHT 600
int main()
{
InitWindow(WIDTH, HEIGHT, "Raylib Draw Rotated Polygon");
float rotation = 0.0f;
SetTargetFPS(60); // Set game to run at 60 frames-per-second
// Main game loop
while (!WindowShouldClose()) // Detect window close button or ESC key
{
rotation += 0.2f;
BeginDrawing();
ClearBackground(RAYWHITE);
// Draw a regular polygon
// void DrawPoly(Vector2 center, int sides, float radius, float rotation, Color color);
DrawPoly((Vector2) { WIDTH / 2.0f, 330 }, 6, 80, rotation, GREEN);
EndDrawing();
}
CloseWindow(); // Close window and OpenGL context
return 0;
}
/*
run:
*/