Results 1 to 10 of 11

Thread: Draw a filled circle

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1

    Draw a filled circle

    Has anybody a suggestion for an algorithm which draws a filled circle? It's not OpenGL but SDL2 based. So used can be drawing a point at x,y or drawing a line or drawing a filled rectangle.

    Ok, I found a solution but it's absolutely slow:
    Code:
    procedure fillcircle (xc,yc,radius:integer);var x,y:integer;
    begin
    for  y :=-radius to radius do begin
        for x :=-radius to radius do begin
            if (x*x+y*y <= radius*radius) then begin
                dot (xc+x, yc+y);
             end;
         end;
     end;
    end;
    If anyone knows a faster one I would appreciate some help.
    Last edited by Cybermonkey; 30-10-2013 at 09:54 PM.
    Best regards,
    Cybermonkey

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •