I have a list of 2D polygons that needs to be sorted

according to drawing order. i.e. the outer most polygons

are rendered first and then polygons within polygons are rendered

later over the tops of parent polygon.

I want to implement this as a linked or doubly linked list. Polygons

are added in ANY order to the list and the list is built such that no

sorting is needed to render. i.e. simply traverse the list from front

to tail. I could have just implemented a linked list and just added

sequentially then did a bubble sort at the end, but this doesn't seem

efficient. Yet....

Seems simple enough at first but, I seem to be having problems

when a parent polygon has more then one subpolygon.

Suggestions or pointers please?

Notes: I have polygon interior/exterior tests working.

I'm working in C++.

TIA

Brian O'Brien.