Using a quad tree to optimize invalidation, rendering and mouse handling