Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I am working on a game in which I have to fill a closed region with color. Currently I'm using a non-recursive, scanline-based flood filling algorithm. But in my case it is slow. Can anyone provide me the quickest, most efficient floodfill algorithm code or link?

share|improve this question

1 Answer 1

up vote 5 down vote accepted

Google provides several links that may be starting points: here, here and here for example.

There isn't likely to be an actual "fastest" or "best" algorithm -- there rarely is. Rather you'll find some are more suited for particular scenarios. You have not provided enough information about your scenario or what you have tried yourself in order for us to provide really directed answers. Also, have you profiled your code and identified the bottleneck(s)?

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.