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/GFX/Actions.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/GFX/Actions.hpp')
| -rw-r--r-- | src/GFX/Actions.hpp | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/src/GFX/Actions.hpp b/src/GFX/Actions.hpp new file mode 100644 index 0000000..cc19169 --- /dev/null +++ b/src/GFX/Actions.hpp @@ -0,0 +1,39 @@ +#pragma once +#include "Mesh.hpp" +#include "Resources.hpp" +#include "../Transform.hpp" + +namespace MC::GFX { + +enum class DrawMode { + Triangles = GL_TRIANGLES, + Lines = GL_LINES, +}; + +struct Action { + Mesh* mesh; + Resources::Program program; + Transform transform; + + F32 alpha = 1.0f; + DrawMode draw_mode = DrawMode::Triangles; +}; + +class Actions { +public: + void add(Action const& action) { + m_actions.push_back(action); + } + + void clear() { + m_actions.clear(); + } + + const std::vector<Action>& actions() const { + return m_actions; + } +private: + std::vector<Action> m_actions; +}; + +} |
