1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071 |
- #ifndef ENGINE_H
- #define ENGINE_H
- #include <cmath>
- #include <cfloat>
- #include "common/utils/Types.h"
- #include "client/input/Keys.h"
- #include "client/input/MouseButtons.h"
- #include "client/math/Ray.h"
- #include "client/rendering/FontRenderer.h"
- #include "client/rendering/Mesh.h"
- #include "client/rendering/Framebuffers.h"
- #include "client/rendering/Shaders.h"
- #include "client/math/Camera.h"
- #include "client/math/Plane.h"
- #include "client/math/MatrixStack.h"
- #include "client/math/Frustum.h"
- #include "client/Game.h"
- #include "client/rendering/NoiseTexture.h"
- #include "client/utils/Clock.h"
- class Engine final {
- public:
- Engine(Shaders& shaders, Framebuffers& fb, const Keys& keys, const MouseButtons& buttons, Camera& camera,
- Ray& ray, const Clock& fps, const WindowSize& size);
- bool isRunning() const;
- void renderTick(float lag);
- void tick();
- static bool useSSAO;
- static float testRadius;
- static float testBias;
- static bool ortho;
- static Vector testOrthoCenter;
- Matrix worldProj;
- Matrix worldView;
- Matrix worldShadowProj;
- Matrix worldShadowView;
- Matrix worldShadowProjView;
- private:
- void renderShadow(float lag);
- void renderWorld(float lag);
- void renderSSAO();
- void renderPostWorld();
- void renderTextOverlay(float lag);
- void updateWorldProjection();
- void updateWorldView();
- Shaders& shaders;
- Framebuffers& fb;
- const Keys& keys;
- const MouseButtons& buttons;
- Game game;
- Camera& camera;
- Frustum frustum;
- MatrixStack model;
- FontRenderer fontRenderer;
- NoiseTexture ssaoNoise;
- Mesh rectangle;
- const Clock& fps;
- const WindowSize& size;
- bool running;
- };
- #endif
|