I'm implementing a display list to manage my visuals on screen.
I want to know which object is clicked.
My objects already have z-order variable.
With my current knowledge (almost nothing) the only thing which comes to my mind is make a linear search and get all the objects which contains the clicked point. And then select the object with the highest z-order. But I know there are far better approaches.
I think it's something with trees (binary search?). - container display objects and search recursively?
just don't know where to start looking, for this concrete case. Any hint link or concrete solution is welcome.