Engine.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. #ifndef ENGINE_H
  2. #define ENGINE_H
  3. #include <cmath>
  4. #include <cfloat>
  5. #include "common/utils/Types.h"
  6. #include "client/math/Ray.h"
  7. #include "client/rendering/FontRenderer.h"
  8. #include "client/rendering/Mesh.h"
  9. #include "client/rendering/Framebuffers.h"
  10. #include "client/rendering/Shaders.h"
  11. #include "client/math/Camera.h"
  12. #include "client/math/Plane.h"
  13. #include "client/math/MatrixStack.h"
  14. #include "client/math/Frustum.h"
  15. #include "client/Game.h"
  16. #include "client/rendering/NoiseTexture.h"
  17. #include "client/utils/Clock.h"
  18. #include "client/rendering/RenderSettings.h"
  19. class Engine final {
  20. public:
  21. Engine(Shaders& shaders, Framebuffers& fb, Camera& camera, const WindowSize& size, RenderSettings& renderSettings);
  22. void renderTick(float lag, const Game& game);
  23. private:
  24. void renderShadow(float lag, const Game& game);
  25. void renderWorld(float lag, const Game& game);
  26. void renderSSAO();
  27. void renderPostWorld();
  28. void renderTextOverlay(float lag, const Game& game);
  29. void updateWorldProjection();
  30. void updateWorldView();
  31. Shaders& shaders;
  32. Framebuffers& fb;
  33. Camera& camera;
  34. const WindowSize& size;
  35. RenderSettings& renderSettings;
  36. Frustum frustum;
  37. MatrixStack model;
  38. FontRenderer fontRenderer;
  39. NoiseTexture ssaoNoise;
  40. Mesh rectangle;
  41. Matrix worldProj;
  42. Matrix worldView;
  43. Matrix worldShadowProj;
  44. Matrix worldShadowView;
  45. Matrix worldShadowProjView;
  46. };
  47. #endif