Main.cpp 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. #include "Game.h"
  2. #include "LayeredFramebuffer.h"
  3. #include "MarchingCubes.h"
  4. #include "gaming-core/rendering/Shader.h"
  5. #include "gaming-core/rendering/Window.h"
  6. #include "gaming-core/wrapper/GL.h"
  7. int main() {
  8. WindowOptions options(4, 0, {1024, 620}, false, "test");
  9. TextInput* input = nullptr;
  10. Window w(input, options);
  11. if(w.getError().has()) {
  12. std::cout << w.getError().message << '\n';
  13. return 0;
  14. }
  15. Shader shader("resources/vertex.vs", "resources/fragment.fs",
  16. "resources/geometry.gs");
  17. if(shader.hasError()) {
  18. return 0;
  19. }
  20. Shader noiceShader("resources/noiceVertex.vs",
  21. "resources/noiceFragment.fs");
  22. if(noiceShader.hasError()) {
  23. return 0;
  24. }
  25. Shader particleShader("resources/particles.vs", "resources/particles.fs",
  26. "resources/particles.gs");
  27. if(particleShader.hasError()) {
  28. return 0;
  29. }
  30. LayeredFramebuffer buffer(64, 64, 64);
  31. if(buffer.hasError()) {
  32. return 0;
  33. }
  34. Game game(shader, noiceShader, particleShader, buffer, w.getButtons(),
  35. w.getSize());
  36. GL::printError("setup error");
  37. GL::enableDepthTesting();
  38. w.run(game, 50'000'000);
  39. return 0;
  40. }