I need 3-5 and sometimes 30 FPS for non-gaming applications with interactive 3D graphics. They should run on inexpensive laptops without noise. I want to try GLFW3 instead of SDL2. Can anyone write a cross platform equivalent of this code using GLFW3:
const float maxFPS = 3.f;
int main()
{
/* ... */
bool running = true;
while (running)
{
float startTicks = SDL_GetTicks();
// Drawing ...
// Limit the FPS to the max FPS
float frameTicks = SDL_GetTicks() - startTicks;
if (1000.f / maxFPS > frameTicks)
{
SDL_Delay(1000.f / maxFPS - frameTicks);
}
}
/* ... */
}