How to draw a circle on mouse point as mouse reference with Raylib in C

1 Answer

0 votes
#include "raylib.h"

#define WIDTH 800
#define HEIGHT 600

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

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

        ClearBackground(RAYWHITE);

        // Draw mouse reference
        // void DrawCircleV(Vector2 center, float radius, Color color); 
        DrawCircleV(GetMousePosition(), 4, DARKGRAY);

        EndDrawing();
    }

    CloseWindow(); // Close window and OpenGL context

    return 0;
}


/*
run:


*/

 



answered Jan 11, 2025 by avibootz

Related questions

1 answer 161 views
1 answer 128 views
128 views asked Jan 11, 2025 by avibootz
1 answer 107 views
107 views asked Jan 16, 2025 by avibootz
1 answer 152 views
152 views asked Jan 12, 2025 by avibootz
...