So I have currently a program displaying a cube. Whenever the user keeps pressing an arrow key the value of 0.20 gets added to a rotation variable to make the cube turn. But sometimes my pc is slower (because of load from other programs or idk why…) and then the cube starts turning slower because the WM_KEYDOWN message is not received as often and thus the 0.20 doesn’t get added the same amount of times.
I was thinking of changing the 0.20 to something like 0.20*(frame_rate) but what do you guys think would be the best way to get the cube turning at a constant speed at any given moment ?
Thanks in advance