From d2b5fc5b3bc648afffa42375706429685ac63794 Mon Sep 17 00:00:00 2001 From: Mel Date: Mon, 12 Feb 2024 12:55:11 +0100 Subject: Split rendering into own thread and sync through render action lists --- src/World/Clouds.hpp | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) (limited to 'src/World/Clouds.hpp') 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; - 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; }; } -- cgit 1.4.1