Added a basic FPS counter to the title
#include <math.h>
#include <SDL2/SDL.h>
#include <wren.h>
+#include <stdlib.h>
// Constants
// Screen dimension constants
@@ -132,6 +133,9 @@ int main(int argc, char* args[])
SDL_RenderClear(engine.renderer);
SDL_RenderCopy(engine.renderer, engine.texture, NULL, NULL);
SDL_RenderPresent(engine.renderer);
+ char buffer[20];
+ snprintf(buffer, sizeof(buffer), "DOME - %.02f fps", 1000.0 / (elapsed+1)); // here 2 means binary
+ SDL_SetWindowTitle(engine.window, buffer);
}
wrenReleaseHandle(vm, initMethod);
