does anybody know how to set the framerate for SDL2-CS?
I am specifically have trouble figuring out what timer to use since there is no SDL timer class I can see.
public static class Sys
{
public const uint FPS = 30;
internal static int frame = 0;
internal static bool cap = true;
internal static ??? timer = ???;
public Init()
{
SDL.SDL_Init(SDL.SDL_INIT_VIDEO);
uint tpf = 1000 / FPS;
bool running = true;
while(running)
{
timer.start();
//Do stuff
uint frameTicks = timer.getTicks();
if (frameTicks < ticks_per_frame)
{
//Wait remaining time
SDL.SDL_Delay(tpf - frameTicks);
}
}
}