Must glutTimerFunc be called in main?

As the question asks, must glutTimerFunc be called in main? basically, i am making a tank game, and im making a movement function. When a key is pressed, the tank will move so many pixels across the screen (Left or right, this is a 2d game).

I want the movement to be a smooth transition, which is why im trying to incoroprate this function in the first place.

Now, i want this only to be triggered when a key is pressed, as i said. Can glutTimerFunc be called by another function, which is inevitably called by glutDisplayFunc?

Im not so sure my question of implementation is clear, but i think it is clear what i want to do.

Can i do this, or is there a better way to implement what i want to do? Thanks.

[This message has been edited by darkenreaper57 (edited 03-10-2004).]

This belongs into the coding: beginners forum.

You cant unregister a glutTimerFunc but you can set a global variable so your callback only does something when a key way pressed.