on the first click, call glutTimerFunc and set a boolean variable (waiting_for_another_click) to true.
on the second click, if waiting_for_another_click==true then that were a double click.
obviously, you have to reset waiting_for_another_click to false when the timer func is called.
2 milliseconds is very short. try 250 milliseconds instead.
Thanks for the reply.
I have initialiaed glutTimerFunc() in the main function, is that ok?
What should be the value of value in
"glutTimerFunc(unsigned int msecs, void (*func)(int value), value); "
you have to call glutTimerFunc each time you want to check a double click, not just in the main function
the value parameter is passed to the callback at the end of msecs milliseconds.
using this value, you are able to define mutliple timer which use the same function but according to value, perform different operations.
you should take a look at: http://www.opengl.org/developers/documentation/glut/spec3/spec3.html
for glut version 3 specification