summaryrefslogtreecommitdiffstats
path: root/src/RendererSection.hpp
diff options
context:
space:
mode:
authorLaG1924 <12997935+LaG1924@users.noreply.github.com>2022-12-15 16:41:06 +0100
committerGitHub <noreply@github.com>2022-12-15 16:41:06 +0100
commitd2b2f223cc62a1cc6e9d41d32020ef94d229a581 (patch)
treede0685c59a55557893d8d6d64bad01e9c98d206a /src/RendererSection.hpp
parentMerge pull request #82 from LaG1924/fix/sdl-wayland-build (diff)
parentAdded liquid rendering pass (diff)
downloadAltCraft-d2b2f223cc62a1cc6e9d41d32020ef94d229a581.tar
AltCraft-d2b2f223cc62a1cc6e9d41d32020ef94d229a581.tar.gz
AltCraft-d2b2f223cc62a1cc6e9d41d32020ef94d229a581.tar.bz2
AltCraft-d2b2f223cc62a1cc6e9d41d32020ef94d229a581.tar.lz
AltCraft-d2b2f223cc62a1cc6e9d41d32020ef94d229a581.tar.xz
AltCraft-d2b2f223cc62a1cc6e9d41d32020ef94d229a581.tar.zst
AltCraft-d2b2f223cc62a1cc6e9d41d32020ef94d229a581.zip
Diffstat (limited to '')
-rw-r--r--src/RendererSection.hpp25
1 files changed, 19 insertions, 6 deletions
diff --git a/src/RendererSection.hpp b/src/RendererSection.hpp
index 0a03f44..8125e4e 100644
--- a/src/RendererSection.hpp
+++ b/src/RendererSection.hpp
@@ -7,26 +7,39 @@ class RenderState;
class RendererSectionData;
class RendererSection {
- std::shared_ptr<Gal::PipelineInstance> pipelineInstance;
- std::shared_ptr<Gal::Buffer> buffer;
- size_t hash;
+ std::shared_ptr<Gal::PipelineInstance> solidPipelineInstance;
+ std::shared_ptr<Gal::Buffer> solidBuffer;
+ std::shared_ptr<Gal::PipelineInstance> liquidPipelineInstance;
+ std::shared_ptr<Gal::Buffer> liquidBuffer;
Vector sectionPos;
+ size_t hash = 0;
+ size_t solidFacesCount = 0;
+ size_t liquidFacesCount = 0;
RendererSection(const RendererSection &other) = delete;
public:
- RendererSection(const RendererSectionData& data, std::shared_ptr<Gal::Pipeline> pipeline, std::shared_ptr<Gal::BufferBinding> bufferBinding);
+ RendererSection(
+ const RendererSectionData& data,
+ std::shared_ptr<Gal::Pipeline> solidPipeline,
+ std::shared_ptr<Gal::BufferBinding> solidBufferBinding,
+ std::shared_ptr<Gal::Pipeline> liquidPipeline,
+ std::shared_ptr<Gal::BufferBinding> liquidBufferBinding);
RendererSection(RendererSection &&other);
~RendererSection();
- void Render();
+ void RenderSolid();
+
+ void RenderLiquid();
Vector GetPosition();
size_t GetHash();
- size_t numOfFaces;
+ inline size_t GetSolidFacesCount() { return solidFacesCount; }
+
+ inline size_t GetLiquidFacesCount() { return liquidFacesCount; }
friend void swap(RendererSection &lhs, RendererSection &rhs);