Changing color when i click

hey
how can i make these shapes change color when i click on them??

#include <windows.h>
#include <glut.h>
#include <math.h>



void display(void)
{
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glPushMatrix();
glColor3f(1.0, 1.0, 0.0);
glPointSize(10);
glBegin(GL_TRIANGLES);
glVertex2i(10, 10);
glVertex2i(0.0, 30);
glVertex2i(-10, 10);
glPopMatrix();
glEnd();

glPushMatrix();
glColor3f(0.5, 1.0, 0.5);
glPointSize(10);
glBegin(GL_POLYGON);
glVertex2i(20, 50);
glVertex2i(40, 50);
glVertex2i(40, 30);
glVertex2i(20, 30);
glPopMatrix();
glEnd();

glPushMatrix();
glColor3f(1, 0.0, 0.0);
glBegin(GL_POLYGON);
for (int i = 0; i < 360; i++) {
float Angle = i * (2.0 * 3.1415 / 360);
float x = cos(Angle) * 12.0;
float y = sin(Angle) * 12.0;
glVertex2f(x - 30, y + 30);
}
glPopMatrix();
glEnd();

glPushMatrix();
glColor3f(0.0, 1.0, 1.0);
glPointSize(10);
glBegin(GL_POLYGON);
glVertex2f(-30, 70);
glVertex2f(10, 70);
glVertex2f(10, 50);
glVertex2f(-30, 50);
glPopMatrix();
glEnd();

glFlush();

}

int main(int argc, char** argv)
{
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB | GLUT_DEPTH);
glutInitWindowSize(500, 500);
glutInitWindowPosition(300, 300);
glutCreateWindow(argv[0]);
glutDisplayFunc(display);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glOrtho(-100, 100, -100, 100, -100, 100);
glClearColor( 0.95,0.95, 0.95, 0);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
glutMainLoop();
return 0;
}

In very crude . basic terms.

Need to identify the “shapes” location - mouse would be my choice.
Is the mouse cursor INSIDE the object ?

Need to identify the “shapes” id code - perhaps putting each one into a “display list” .
Which item in display list is selected ?