// Draw a filled circle (using SDL_RenderFillRect would be simpler, but we approximate) // For a real circle, we'd use a texture, but SDL3's renderer still lacks native circle. // Let's draw a simple rectangle to keep the example focused. SDL_FRect ball_rect = ball_x - BALL_RADIUS, ball_y - BALL_RADIUS, BALL_RADIUS * 2, BALL_RADIUS * 2 ; SDL_SetRenderDrawColor(renderer, 0, 0, 255, 255); // blue SDL_RenderFillRect(renderer, &ball_rect);
Are you planning to use or are you interested in testing out the new GPU abstraction layer ? sdl3 example
#define SCREEN_WIDTH 640 #define SCREEN_HEIGHT 480 #define BALL_RADIUS 20 // Draw a filled circle (using SDL_RenderFillRect would
This will create an executable file bouncing_ball and run it. You should see a window with a bouncing blue ball. we'd use a texture