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

Buy a domain name - Register cheap domain names from $0.99 - Namecheap

Scalable Hosting That Grows With You

Secure & Reliable Web Hosting, Free Domain, Free SSL, 1-Click WordPress Install, Expert 24/7 Support

Semrush - keyword research tool

Boost your online presence with premium web hosting and servers

Disclosure: My content contains affiliate links.

39,945 questions

51,887 answers

573 users

How to draw a circle with Raylib in C

1 Answer

0 votes
#include "raylib.h"

#define WIDTH 800
#define HEIGHT 600

int main()
{
    InitWindow(WIDTH, HEIGHT, "Raylib Draw Circle");

    // Main game loop
    while (!WindowShouldClose()) // Detect window close button or ESC key
    {
        BeginDrawing();

        ClearBackground(RAYWHITE);

        // void DrawCircle(int centerX, int centerY, float radius, Color color);  
        DrawCircle(WIDTH / 2, HEIGHT / 2, 60, DARKGRAY);
   
        // void DrawCircleGradient(int centerX, int centerY, float radius, Color inner, Color outer);
        DrawCircleGradient(WIDTH / 5, 200, 60, GREEN, SKYBLUE);

        // void DrawCircleLines(int centerX, int centerY, float radius, Color color);  
        DrawCircleLines(WIDTH / 5, 380, 80, DARKBLUE);

        EndDrawing();
    }

    CloseWindow(); // Close window and OpenGL context

    return 0;
}


/*
run:


*/

 



answered Jan 11, 2025 by avibootz
edited Jan 11, 2025 by avibootz

Related questions

1 answer 93 views
93 views asked Jan 16, 2025 by avibootz
1 answer 126 views
126 views asked Jan 12, 2025 by avibootz
1 answer 103 views
103 views asked Jan 12, 2025 by avibootz
...