123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869 |
- #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/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"
- class Engine {
- public:
- Engine(Shaders& shaders, Framebuffers& fb, const Keys& keys, const MouseButtons& buttons, 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;
- bool once = true;
- 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 cam;
- Frustum frustum;
- MatrixStack model;
- FontRenderer fontRenderer;
- NoiseTexture ssaoNoise;
- Mesh rectangle;
- const WindowSize& size;
- bool running;
- };
- #endif
|