1

is there a sdl "draw circle" function? or should i make it from cero? or, instead of that... is there an already made function in c++ for that?

something like:

int main (){ // create the window SDL_Window * window1 = SDL_CreateWindow("Window",700,50,500,450, SDL_WINDOW_SHOWN); // create the renderer SDL_Renderer * renderer = SDL_CreateRenderer( window1, -1 , SDL_RENDERER_ACCELERATED); // Set background SDL_SetRenderDrawColor( renderer, 255, 255, 255, 255 ); SDL_RenderClear( renderer ); SDL_RenderPresent(renderer); // Set circle's position int x = 100; int y = 100; int radius = 40; // Loop to hold the window in screen bool running = true; while(running) { SDL_Event event1; while(SDL_PollEvent(&event1) !=0){ // CIRCLE FUNCTION ?????? functionSDLcircle(x, y, radius); if(event1.type ==SDL_KEYDOWN) { switch (event1.key.keysym.sym){ case SDLK_RETURN: running = false; break; } } } } return 0; } 
1
  • 1
    If you want higher-level functions like circles without grabbing a full game engine, I would recommend the excellent SFML (Simple Fast Media Library). Commented Sep 18, 2017 at 15:34

1 Answer 1

2

Nope, nothing like that off-the-shelf in the SDL_Renderer system.

You'll have to roll your own using SDL_RenderDrawLines()/OpenGL or switch to something like SDL2_gfx.

Sign up to request clarification or add additional context in comments.

1 Comment

thanks genpfault. yes, i have sdl2. Can you guide me how is with the sdl2_gfx?

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.