|
@@ -1,13 +1,13 @@
|
|
#include "Game.h"
|
|
#include "Game.h"
|
|
#include "LayeredFramebuffer.h"
|
|
#include "LayeredFramebuffer.h"
|
|
#include "gaming-core/input/Buttons.h"
|
|
#include "gaming-core/input/Buttons.h"
|
|
|
|
+#include "gaming-core/rendering/Shader.h"
|
|
|
|
+#include "gaming-core/rendering/Window.h"
|
|
|
|
+#include "gaming-core/rendering/WindowOptions.h"
|
|
#include "gaming-core/utils/Clock.h"
|
|
#include "gaming-core/utils/Clock.h"
|
|
#include "gaming-core/wrapper/GL.h"
|
|
#include "gaming-core/wrapper/GL.h"
|
|
#include "gaming-core/wrapper/GLEW.h"
|
|
#include "gaming-core/wrapper/GLEW.h"
|
|
#include "gaming-core/wrapper/GLFW.h"
|
|
#include "gaming-core/wrapper/GLFW.h"
|
|
-#include "gaming-core/wrapper/Shader.h"
|
|
|
|
-#include "gaming-core/wrapper/Window.h"
|
|
|
|
-#include "gaming-core/wrapper/WindowOptions.h"
|
|
|
|
|
|
|
|
void updateSize(const Window& window, Size& size) {
|
|
void updateSize(const Window& window, Size& size) {
|
|
Size newSize = window.getSize();
|
|
Size newSize = window.getSize();
|
|
@@ -53,13 +53,13 @@ int main() {
|
|
|
|
|
|
Game game(shader, noiceShader, buffer, buttons, size);
|
|
Game game(shader, noiceShader, buffer, buttons, size);
|
|
|
|
|
|
- GL::checkAndPrintError("setup error");
|
|
|
|
|
|
+ GL::printError("setup error");
|
|
GL::enableDepthTesting();
|
|
GL::enableDepthTesting();
|
|
|
|
|
|
const Clock::Nanos nanosPerTick = 50000000;
|
|
const Clock::Nanos nanosPerTick = 50000000;
|
|
Clock::Nanos lag = 0;
|
|
Clock::Nanos lag = 0;
|
|
while(!window.shouldClose()) {
|
|
while(!window.shouldClose()) {
|
|
- GL::checkAndPrintError("loop error");
|
|
|
|
|
|
+ GL::printError("loop error");
|
|
updateSize(window, size);
|
|
updateSize(window, size);
|
|
game.render(static_cast<float>(lag) / nanosPerTick);
|
|
game.render(static_cast<float>(lag) / nanosPerTick);
|
|
window.swapBuffers();
|
|
window.swapBuffers();
|