Game.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. #ifndef GAME_H
  2. #define GAME_H
  3. #include "client/input/Control.h"
  4. #include "client/math/Camera.h"
  5. #include "client/utils/Clock.h"
  6. #include "client/rendering/RenderSettings.h"
  7. #include "client/rendering/Renderer.h"
  8. #include "client/rendering/Mesh.h"
  9. #include "client/rendering/FileTexture.h"
  10. #include "client/rendering/FontRenderer.h"
  11. class Game final {
  12. public:
  13. Game(const Control& control, const Camera& camera, Ray& ray, const Clock& fps, const Clock& tps,
  14. RenderSettings& renderSettings);
  15. void tick();
  16. void renderWorld(float lag, Renderer& renderer) const;
  17. void renderTextOverlay(float lag, Renderer& renderer, FontRenderer& fr) const;
  18. bool isRunning() const;
  19. private:
  20. void addCube(float x, float y, float z, bool bottom, bool top, bool left, bool right, bool front, bool back);
  21. const Control& control;
  22. const Camera& camera;
  23. Ray& ray;
  24. const Clock& fps;
  25. const Clock& tps;
  26. RenderSettings& renderSettings;
  27. float lengthAngle;
  28. float widthAngle;
  29. Vector pos;
  30. Mesh m;
  31. FileTexture texture;
  32. };
  33. #endif