   How to use glutMotionFunc
  I am trying to make a LUDO game which involves translating Ludos(disks) from one position to another.I want to do this translation using mouse i.e. by draging a ludo from one position and place it to another.Can I use glutMotionFunc() to do this? If yes then give me discription of this funciton by an example. If no then tell me what to do??? please reply as soon as possible.thanks   
The trick here is that you need to remember stuff between callbacks; you need to remember what's currently being dragged.So when you get glutMouseFunc() and it tells you a button is pressed, you look at the XY, find the piece at that position, remember that it's being moved.When you get glutMouseMotion(), you change the "being dragged" piece's position to be the XY. (and ask for a redraw event, so you can draw stuff in the moved place).When you get glutMouseFunc() with the button release, you set "currently being dragged" to "none".You should probably also handle glutMouseEntry() telling you the pointer has left the window, and drop the piece at that point. (so it never leaves visibility).Be careful about the button release, because it's possible to get that without a corresponding press -- if that happened outside your window.;  can you write a function which drags a square?   ;  I don't know yet -- How much would you pay me for it?