aboutsummaryrefslogtreecommitdiff
path: root/src/States/SimulationState.h
diff options
context:
space:
mode:
authorhachem <im@hachem.wtf>2025-08-14 00:02:01 +0200
committerhachem <im@hachem.wtf>2025-08-14 00:02:01 +0200
commit641db1c86bf624527173b0323bd3c832338c3662 (patch)
tree188fe41c2351b8b426b8904ea23faec68f4144a4 /src/States/SimulationState.h
parent6afeab30f84bc19fc4fc3dd842e7b093d4c5a9fa (diff)
[add]: State manager
Diffstat (limited to 'src/States/SimulationState.h')
-rw-r--r--src/States/SimulationState.h56
1 files changed, 56 insertions, 0 deletions
diff --git a/src/States/SimulationState.h b/src/States/SimulationState.h
new file mode 100644
index 0000000..d2f0106
--- /dev/null
+++ b/src/States/SimulationState.h
@@ -0,0 +1,56 @@
+#pragma once
+
+#include "Core/State.h"
+#include "Core/Event.h"
+#include "Core/Camera.h"
+#include "Core/Log.h"
+
+#include "Rendering/VertexArray.h"
+#include "Rendering/VertexBuffer.h"
+#include "Rendering/IndexBuffer.h"
+#include "Rendering/Shader.h"
+#include "Rendering/Texture.h"
+
+namespace Donut
+{
+ class SimulationState
+ : public State
+ {
+ public:
+ ~SimulationState() = default;
+
+ void OnEnter() override;
+ void OnExit() override;
+ void OnUpdate(float deltaTime) override;
+ void OnRender() override;
+ void OnEvent(Event& event) override;
+ private:
+ void HandleKeyInput(float deltaTime);
+ void UpdateTexture();
+ private:
+ std::unique_ptr<Camera> m_Camera;
+
+ std::shared_ptr<VertexArray> m_VertexArray;
+ std::shared_ptr<VertexBuffer> m_VertexBuffer;
+ std::shared_ptr<IndexBuffer> m_IndexBuffer;
+ std::shared_ptr<Shader> m_Shader;
+ std::shared_ptr<Texture2D> m_Texture;
+
+ std::shared_ptr<Shader> m_ComputeShader;
+ std::shared_ptr<Texture2D> m_ProcessedTexture;
+
+ float m_ComputeBrightness = 0.0f;
+ float m_ComputeContrast = 1.0f;
+ float m_ComputeSaturation = 1.0f;
+ bool m_UseComputeShader = true;
+
+ bool m_Keys[1024] = { false };
+ bool m_FirstMouse = true;
+ float m_LastX = 0.0f;
+ float m_LastY = 0.0f;
+ float m_DeltaTime = 0.0f;
+ float m_LastFrame = 0.0f;
+ bool m_MouseDragging = false;
+ float m_TextureTime = 0.0f;
+ };
+};