Game.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  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/wrapper/Shader.h"
  8. #include "client/math/MatrixStack.h"
  9. #include "client/rendering/Mesh.h"
  10. #include "client/rendering/Texture.h"
  11. #include "client/rendering/FontRenderer.h"
  12. class Game final {
  13. public:
  14. Game(const Control& control, const Camera& camera, Ray& ray, const Clock& fps, const Clock& tps,
  15. RenderSettings& renderSettings);
  16. void tick();
  17. void renderWorld(float lag, MatrixStack& stack, Shader& sh) const;
  18. void renderTextOverlay(float lag, MatrixStack& stack, Shader& sh, FontRenderer& fr) const;
  19. bool isRunning() const;
  20. private:
  21. void addCube(float x, float y, float z, bool bottom, bool top, bool left, bool right, bool front, bool back);
  22. const Control& control;
  23. const Camera& camera;
  24. Ray& ray;
  25. const Clock& fps;
  26. const Clock& tps;
  27. RenderSettings& renderSettings;
  28. float lengthAngle;
  29. float widthAngle;
  30. Vector pos;
  31. Mesh m;
  32. Texture texture;
  33. };
  34. #endif