Commit dec129c6 authored by Elias Broschin's avatar Elias Broschin
Browse files

Merge branch 'develop' into feature/physics/movement

parents b127b4ad b04771c4
# FSI-Lizenz
Copyright © 2015 Benjamin Albsmeier, Johannes Kirchner, Michael Ochmann
Copyright © 2015 Benjamin Albsmeier, Johannes Kirchner, Michael Ochmann, Jeremias Boos,
Hiermit wird unentgeltlich jeder Person, die eine Kopie der Software und der zugehörigen Dokumentationen
(die "Software") erhält, die Erlaubnis erteilt, sie uneingeschränkt zu benutzen, inklusive und ohne Ausnahme dem Recht,
......
......@@ -70,5 +70,7 @@ solution "gdw_ss15_cpp"
"copy \"lib\\sdl2\\x86_64-w64-mingw32\\bin\\SDL2.dll\" \"build\"",
"copy \"lib\\sdl2_mixer\\x86_64-w64-mingw32\\bin\\*.dll\" \"build\""
}
linkoptions {"-lmingw32 lib/glew/build/GLEW.lib -lopengl32 -static-libgcc -static-libstdc++"}
--linkoptions{"-lmingw32 lib/glew/build/GLEW.lib -lopengl32 -lSDL2main -lSDL2 -lSDL2_mixer -static-libgcc -static-libstdc++"}
linkoptions {"-limagehlp -lmingw32 lib/glew/build/GLEW.lib -lopengl32 -static-libgcc -static-libstdc++"}
links {"GLEW", "SDL2main", "SDL2", "SDL2_mixer"}
#include <chrono>
#include <SDL.h>
#include <asset/asset.hpp>
......@@ -50,9 +48,8 @@ namespace gdw {
void engine::run() {
auto event = SDL_Event();
auto duration = std::chrono::high_resolution_clock::now().time_since_epoch();
auto last_time = 0.f;
auto current_time = std::chrono::duration_cast<std::chrono::duration<float>>(duration).count();
auto current_time = static_cast<float>(SDL_GetTicks()) / 1000.f;
auto delta_time = 0.f;
while (!quit_) {
......@@ -61,9 +58,8 @@ namespace gdw {
quit_ = true;
}
}
duration = std::chrono::high_resolution_clock::now().time_since_epoch();
last_time = current_time;
current_time = std::chrono::duration_cast<std::chrono::duration<float>>(duration).count();
current_time = static_cast<float>(SDL_GetTicks()) / 1000.f;
delta_time = current_time - last_time;
update(delta_time);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment