Question: Last 2 weeks I started working on a box selection that selects shapes using GL\_SELECT and I just got it working finally.

When looking up resources online, there is a significant number of posts that say GL\_SELECT is deprecated in OpenGL 3.0, but there is no mention of what had replace that function.

I learnt OpenGL 1.2 in back in college 2 years back but checking wikipedia now, I realise we already have OpenGL 4.0 but I am unaware of what I need to do to keep myself up to date.

So, in the meantime, what would be the latest preferred method for box selection?

EDIT: I found <http://www.khronos.org/files/opengl-quick-reference-card.pdf> on page 5 this card still lists glRenderMode(GL\_SELECT) as part of the OpenGL 3.2 reference.

Answer: 
The way I do picking in core OpenGL is to assign a unique color to every object in the world and draw only the vertices (no texcoords, normals, etc.) with the assigned color to a [FBO](http://www.opengl.org/wiki/Framebuffer_Object).

Once all the objects have been drawn, you can call [glReadPixels](http://www.opengl.org/sdk/docs/man/xhtml/glReadPixels.xml) at the mouse coordinate with a width and height of 1 to get the pixel color at that point. Then all you have to do is lookup which object was assigned to that color and return it.

If you want to drag-select a rectangle, do the same thing, but store the pressed mouse coordinate and change the parameters of glReadPixels to read back the selected rectangle between the pressed mouse coordinate and the released mouse coordinate.
You could use something like [Bullet](http://bulletphysics.org/).

It's a physics library but you can just use it for ray collision. I (should) be using it soon for my project.