dimanche 15 mars 2015

How to use SDL2's timer functions to increase a variable by 1 every xxx ms


Using SDL2's time functions, this is what I want to happen inside my main loop:



if (angle < 360)
{
...every 300ms angle++ <-----how to use SDL's time functions to do this ?
}
else
{
angle == 0;
}


I'll be using this angle variable as an arguement for SDL_RenderCopyEx to render a rotating texture...




Aucun commentaire:

Enregistrer un commentaire