Welcome to collectivesolver - Programming & Software Q&A with code examples. A website with trusted programming answers. All programs are tested and work.

Contact: aviboots(AT)netvision.net.il

Semrush - keyword research tool

Turn ChatGPT, Claude, Gemini, And CoPilot Into Your Personal Assistant, Business Coach, Content Creator, And More

AFFILIATE MARKETING Your all-in-one performance engine Manage affiliates, creators, and customer referrals in one unified platform—turning every partnership into measurable growth
Secure & Reliable Web Hosting, Free Domain, Free SSL, 1-Click WordPress Install, Expert 24/7 Support

Boost your online presence with premium web hosting and servers

Disclosure: My content contains affiliate links.

42,656 questions

55,407 answers

573 users

How to draw a rotated polygon with Raylib in C

1 Answer

0 votes
#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:


*/

 



answered Jan 12, 2025 by avibootz
edited Jan 13, 2025 by avibootz

Related questions

1 answer 129 views
129 views asked Jan 16, 2025 by avibootz
1 answer 174 views
174 views asked Jan 12, 2025 by avibootz
1 answer 150 views
150 views asked Jan 12, 2025 by avibootz
...