diff options
| author | Mel <einebeere@gmail.com> | 2024-02-12 12:55:11 +0100 |
|---|---|---|
| committer | Mel <einebeere@gmail.com> | 2024-02-12 12:55:11 +0100 |
| commit | d2b5fc5b3bc648afffa42375706429685ac63794 (patch) | |
| tree | a2dfbb241e1d46e5616c5884e5f3d685de2a2cb6 /src/Util/ImageViewer.hpp | |
| parent | 588c7e87b7cab270698d43ca5c22d67793ae5fc4 (diff) | |
| download | meowcraft-d2b5fc5b3bc648afffa42375706429685ac63794.tar.zst meowcraft-d2b5fc5b3bc648afffa42375706429685ac63794.zip | |
Split rendering into own thread and sync through render action lists
Diffstat (limited to 'src/Util/ImageViewer.hpp')
| -rw-r--r-- | src/Util/ImageViewer.hpp | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/Util/ImageViewer.hpp b/src/Util/ImageViewer.hpp index aa48b1e..cfe9d18 100644 --- a/src/Util/ImageViewer.hpp +++ b/src/Util/ImageViewer.hpp @@ -1,27 +1,25 @@ #pragma once +#include "../GFX/Actions.hpp" #include "../GFX/Mesh.hpp" #include "../GFX/Image/RawImage.hpp" #include "../GFX/Texture.hpp" -#include "../GFX/Shading/Program.hpp" namespace MC::Util { class ImageViewer { public: - explicit ImageViewer(const GFX::Image::RawImage& image, Real window_aspect); + explicit ImageViewer(const GFX::Image::RawImage& image, Real window_aspect) + : m_mesh(create_mesh(window_aspect, image.width(), image.height())), + m_texture(image) {} - void render(); + void render(GFX::Actions& actions); private: static GFX::Mesh create_mesh(Real window_aspect, U32 image_width, U32 image_height); static constexpr Real view_size = 1000.0f; - static const Char* vertex; - static const Char* fragment; - GFX::Mesh m_mesh; - GFX::Shading::Program m_program; GFX::Texture m_texture; }; |
