Skip to content

Commit

Permalink
Fix FPS counter
Browse files Browse the repository at this point in the history
  • Loading branch information
pfcode committed May 31, 2021
1 parent 54efe27 commit 3e2266f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

# CMake
cmake-build-debug
cmake-build-release

# CLion
.idea
3 changes: 0 additions & 3 deletions src/render.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,6 @@ Render::Render(Map *_map){

SDL_SetWindowTitle(window, WINDOW_TITLE);

printf("xd\n");


screen = SDL_CreateRGBSurface(0, INIT_WIDTH, INIT_HEIGHT, 32, 0x00FF0000, 0x0000FF00, 0x000000FF, 0xFF000000);
scrtex = SDL_CreateTexture(renderer, SDL_PIXELFORMAT_ARGB8888, SDL_TEXTUREACCESS_STREAMING, INIT_WIDTH, INIT_HEIGHT);

Expand Down
6 changes: 3 additions & 3 deletions src/render.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ class Render{
private:
// General
Map *map;
int lastFPSCalc;
int framesInSec;
int fps;
int lastFPSCalc = 0;
int framesInSec = 0;
int fps = 0;
void calcFPS();

// SDL General
Expand Down

0 comments on commit 3e2266f

Please sign in to comment.