I have set up color-picking of objects in my application, where I do a render with all objects colored in a unique color, and then GL.ReadPixel to find the color at the position where I clicked the mouse...
This has worked very well so far, but I need to expand it to a system where I can drag a rectangle, and then get all the objects inside this rectangle...
The only way I can see how to do this is to copy the pixels inside the rectangle, and then find all the unique colors in the copied image... Each of these unique colors would represent an object.
My question is then whether anyone has a better method, or if not; what is the quickest way to copy a range of pixels from OpenGL? (Any pointers to a quick Unique-color search is also appreciated)
I expect that this problem has been solved before, and look forward to reading some good tips and input :)