Browse Source

tiny stuff

opengl-renderer-broken
Martin Dørum 4 years ago
parent
commit
49b180cea4
2 changed files with 3 additions and 3 deletions
  1. 1
    1
      CMakeLists.txt
  2. 2
    2
      src/main.cc

+ 1
- 1
CMakeLists.txt View File

@@ -16,7 +16,7 @@ if(CMAKE_BUILD_TYPE STREQUAL Sanitize OR CMAKE_BUILD_TYPE STREQUAL "")
add_link_options(-fsanitize=address -fsanitize=undefined)
elseif(CMAKE_BUILD_TYPE STREQUAL Debug)
message(STATUS "Build mode: Debug")
add_compile_options(-g -Og)
add_compile_options(-g -O0)
elseif(CMAKE_BUILD_TYPE STREQUAL Profile)
message(STATUS "Build mode: Profile")
add_compile_options(-g -Og -pg)

+ 2
- 2
src/main.cc View File

@@ -164,9 +164,9 @@ int main(int argc, char **argv) {

// Complex case: run multiple steps this iteration
} else {
int count = (int)ceilf(dt / (1/30.0));
int count = (int)ceil(dt / (1/30.0));
pcounter.countGameUpdatesPerFrame(count);
float delta = dt / count;
float delta = dt / (float)count;
info << "Delta time " << dt << "s. Running " << count << " updates in one frame, with a delta as if we had " << 1.0 / delta << " FPS.";
for (int i = 0; i < count; ++i)
game.update(delta);

Loading…
Cancel
Save