summary refs log tree commit diff
path: root/src/World/Clouds.hpp
diff options
context:
space:
mode:
authorMel <einebeere@gmail.com>2024-02-12 12:55:11 +0100
committerMel <einebeere@gmail.com>2024-02-12 12:55:11 +0100
commitd2b5fc5b3bc648afffa42375706429685ac63794 (patch)
treea2dfbb241e1d46e5616c5884e5f3d685de2a2cb6 /src/World/Clouds.hpp
parent588c7e87b7cab270698d43ca5c22d67793ae5fc4 (diff)
downloadmeowcraft-d2b5fc5b3bc648afffa42375706429685ac63794.tar.zst
meowcraft-d2b5fc5b3bc648afffa42375706429685ac63794.zip
Split rendering into own thread and sync through render action lists
Diffstat (limited to 'src/World/Clouds.hpp')
-rw-r--r--src/World/Clouds.hpp22
1 files changed, 6 insertions, 16 deletions
diff --git a/src/World/Clouds.hpp b/src/World/Clouds.hpp
index 4bd0637..7246e7b 100644
--- a/src/World/Clouds.hpp
+++ b/src/World/Clouds.hpp
@@ -1,8 +1,7 @@
 #pragma once
 
 #include "../Time.hpp"
-#include "../GFX/Shading/Program.hpp"
-#include "../GFX/Shading/Uniform.hpp"
+#include "../GFX/Actions.hpp"
 #include "../GFX/Camera.hpp"
 #include "../GFX/Mesh.hpp"
 
@@ -10,10 +9,10 @@ namespace MC::World {
 
 class Clouds {
 public:
-    Clouds(Real ascept, Real fov, Real near, Real far, Vector<3, F32> sky_color, Vector<3, F32> sun_direction);
+    Clouds() : m_mesh(create_mesh(create_cloud_matrix())) {}
 
-    void update(const Time& time);
-    void render(const GFX::Camera& camera);
+    void update(Time const& time);
+    void render(GFX::Actions& actions, Position::World player_position);
 private:
     constexpr static U32 CloudMatrixSize = 128;
     constexpr static Int Height = 200;
@@ -22,22 +21,13 @@ private:
 
     using CloudMatrix = Matrix<CloudMatrixSize, CloudMatrixSize, Bool>;
 
-    void render_single_instance(const GFX::Camera& camera, Int x, Int y);
+    void render_single_instance(GFX::Actions& actions, Int x, Int y);
 
     static CloudMatrix create_cloud_matrix();
-    static GFX::Mesh create_mesh(const CloudMatrix& cloud_matrix);
-
-    static const Char* vertex;
-    static const Char* fragment;
+    static GFX::Mesh create_mesh(CloudMatrix const& cloud_matrix);
 
     Real m_x_offset = 0.0;
-
-    GFX::Shading::Program m_program;
     GFX::Mesh m_mesh;
-
-    GFX::Shading::Uniform m_model_uniform;
-    GFX::Shading::Uniform m_view_uniform;
-    GFX::Shading::Uniform m_projection_uniform;
 };
 
 }