Skip to content

Instantly share code, notes, and snippets.

View Harshithpm's full-sized avatar
😇
hello everyone!

DDH-code Harshithpm

😇
hello everyone!
View GitHub Profile
@Harshithpm
Harshithpm / timestepping-sdl2.cpp
Last active December 17, 2021 06:41
Some code to make sure CPU consumption is low in SDL2/C++
bool gameRunning = true;
SDL_Event event;
const float timeStep = 0.01f;
float accumulater = 0.0f;
float currentTime = utils::hireTimeInSeconds();
while (gameRunning) {