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 by avibootz
edited Jan 11 by avibootz
...