Engine.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. #ifndef ENGINE_H
  2. #define ENGINE_H
  3. #include "client/Game.h"
  4. #include "client/rendering/Framebuffers.h"
  5. #include "client/rendering/Mesh.h"
  6. #include "client/rendering/NoiseTexture.h"
  7. #include "client/rendering/RenderSettings.h"
  8. #include "client/rendering/Renderer.h"
  9. #include "client/rendering/Shaders.h"
  10. #include "gaming-core/math/Frustum.h"
  11. class Engine final {
  12. Shaders& shaders;
  13. Framebuffers& framebuffers;
  14. Size lastSize;
  15. const Size& size;
  16. RenderSettings& renderSettings;
  17. Game& game;
  18. Frustum frustum;
  19. MatrixStack<16> model;
  20. Renderer renderer;
  21. NoiseTexture ssaoNoise;
  22. Mesh rectangle;
  23. Matrix worldProj;
  24. Matrix worldView;
  25. Matrix worldShadowProj;
  26. Matrix worldShadowView;
  27. Matrix worldShadowProjView;
  28. public:
  29. Engine(Shaders& shaders, Framebuffers& fb, const Size& size,
  30. RenderSettings& renderSettings, Game& game);
  31. void render(float lag);
  32. void tick();
  33. bool isRunning() const;
  34. private:
  35. void renderShadow(float lag);
  36. void renderWorld(float lag);
  37. void renderSSAO();
  38. void renderPostWorld();
  39. void renderOverlay(float lag);
  40. void updateWorldProjection();
  41. void updateWorldView();
  42. };
  43. #endif