Engine.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. #ifndef ENGINE_H
  2. #define ENGINE_H
  3. #include <cmath>
  4. #include <cfloat>
  5. #include "common/utils/Types.h"
  6. #include "client/input/Keys.h"
  7. #include "client/input/MouseButtons.h"
  8. #include "client/rendering/FontRenderer.h"
  9. #include "client/rendering/Mesh.h"
  10. #include "client/rendering/Framebuffers.h"
  11. #include "client/rendering/Shaders.h"
  12. #include "client/math/Camera.h"
  13. #include "client/math/Plane.h"
  14. #include "client/math/MatrixStack.h"
  15. #include "client/math/Frustum.h"
  16. #include "client/Game.h"
  17. #include "client/rendering/NoiseTexture.h"
  18. class Engine {
  19. public:
  20. Engine(Shaders& shaders, Framebuffers& fb, const Keys& keys, const MouseButtons& buttons, const WindowSize& size);
  21. bool isRunning() const;
  22. void renderTick(float lag);
  23. void tick();
  24. static bool useSSAO;
  25. static float testRadius;
  26. static float testBias;
  27. static bool ortho;
  28. static Vector testOrthoCenter;
  29. bool once = true;
  30. Matrix worldProj;
  31. Matrix worldView;
  32. Matrix worldShadowProj;
  33. Matrix worldShadowView;
  34. Matrix worldShadowProjView;
  35. private:
  36. void renderShadow(float lag);
  37. void renderWorld(float lag);
  38. void renderSSAO();
  39. void renderPostWorld();
  40. void renderTextOverlay(float lag);
  41. void updateWorldProjection();
  42. void updateWorldView();
  43. Shaders& shaders;
  44. Framebuffers& fb;
  45. const Keys& keys;
  46. const MouseButtons& buttons;
  47. Game game;
  48. Camera cam;
  49. Frustum frustum;
  50. MatrixStack model;
  51. FontRenderer fontRenderer;
  52. NoiseTexture ssaoNoise;
  53. Mesh rectangle;
  54. const WindowSize& size;
  55. bool running;
  56. };
  57. #endif