|
@@ -35,13 +35,6 @@ void initCallbacks(Window& w, WindowSize& size, Controller& controller) {
|
|
|
} else if(action == GLFW_RELEASE) {
|
|
|
cControl.keys.release(key);
|
|
|
}
|
|
|
- });
|
|
|
- w.setMouseButtonCallback([](GLFWwindow*, int button, int action, int) {
|
|
|
- if(action == GLFW_PRESS) {
|
|
|
- cControl.buttons.press(button);
|
|
|
- } else if(action == GLFW_RELEASE) {
|
|
|
- cControl.buttons.release(button);
|
|
|
- }
|
|
|
});*/
|
|
|
}
|
|
|
|
|
@@ -76,6 +69,14 @@ int main() {
|
|
|
u64 lag = 0;
|
|
|
while(!window.shouldClose() && game.isRunning()) {
|
|
|
GLWrapper::checkAndPrintError("GL-Error");
|
|
|
+
|
|
|
+ lag += fps.update();
|
|
|
+ while(lag >= nanosPerTick) {
|
|
|
+ lag -= nanosPerTick;
|
|
|
+ tps.update();
|
|
|
+ controller.tick();
|
|
|
+ game.tick();
|
|
|
+ }
|
|
|
|
|
|
Matrix view;
|
|
|
view.translate(-1.0f, 1.0f);
|
|
@@ -85,13 +86,6 @@ int main() {
|
|
|
game.render((float) lag / nanosPerTick, renderer);
|
|
|
window.swapBuffers();
|
|
|
|
|
|
- lag += fps.update();
|
|
|
- while(lag >= nanosPerTick) {
|
|
|
- lag -= nanosPerTick;
|
|
|
- tps.update();
|
|
|
- controller.tick();
|
|
|
- game.tick();
|
|
|
- }
|
|
|
glfwPollEvents();
|
|
|
}
|
|
|
|