In modern OpenGL you shouldn't use GL_SELECT for objects picking since OpenGL is an API for hardware accelarated graphics drawing. But there are other methods which you can use.
As @Robert wrote, you can use color selection in order to pick objects on the screen. Another thing you can do is to cast a ray from the mouse cursor to the game world and check for collisions between the ray and the world's geometry.
To construct the ray, you will need to get the mouse cursor's position in world space. That position will be of use to you in order to calculate the ray's direction. The ray's origin is the position of your camera. Now that you have the ray, you can make an intersection test between the ray and the geometry you are trying to pick. If the test succeeds, then you have a clicked object, else you don't have one.
The code concerning the ray's construction is the following:
Ray Mouse::GetPickRay(mat4 projMat, mat4 modelMat,
int windowWidth, int windowHeight)
float mouseX = float(this->currentPosition.x);
float mouseY = float(this->currentPosition.y);
vec4 mousePos_clipSpace = vec4(
((mouseX * 2.0f) / windowWidth) - 1.0f,
(1.0f - (2.0f * mouseY) / windowHeight),
vec4 mousePos_viewSpace = inverse(projMat) * mousePos_clipSpace;
mousePos_viewSpace = mousePos_viewSpace / mousePos_viewSpace.w;
vec4 mousePos_worldSpace = inverse(modelMat) * mousePos_viewSpace;
vec4 rayDirection = normalize(mousePos_worldSpace - cameraPos);
vec4 rayOrigin = cameraPos;
return Ray(rayOrigin, rayDirection);
This article describes very well the logic behind the unprojection of the mouse cursor's coordinates and the creation of the ray.
The only thing that's left is to check for intersections between the ray and the world's geometry. You can find various algorithms on the Internet about how to do that.