I need animation to run, no matter - was the key pressed or it wasn't.
Also - I have to check if user have pressed some key and get the key code if he did.
getc waits for user to input something - therefore stops the animation. I have already done something like this once, but I've forgoten which function I used back there.
If you use the old conio.h library you could do something like this:
1 2 3 4 5 6 7 8 9 10 11 12 13 14
char c;
while(1)
{
if (kbhit()) //checks if there is data in the input buffer
{
c=getchar();
//do something with c...
}
Sleep(50);
run_next_animation_frame();
}