From f942405184c2d6067fb5303b58a225edf7e452b1 Mon Sep 17 00:00:00 2001 From: LaG1924 <12997935+LaG1924@users.noreply.github.com> Date: Sat, 29 Jul 2017 19:55:16 +0500 Subject: 2017-07-29 --- src/RendererSection.hpp | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 src/RendererSection.hpp (limited to 'src/RendererSection.hpp') diff --git a/src/RendererSection.hpp b/src/RendererSection.hpp new file mode 100644 index 0000000..093a977 --- /dev/null +++ b/src/RendererSection.hpp @@ -0,0 +1,49 @@ +#pragma once + +#include +#include +#include +#include +#include +#include + +#include "AssetManager.hpp" +#include "Section.hpp" +#include "World.hpp" +#include "Vector.hpp" +#include "Renderer.hpp" + +class RendererSection : Renderer { + Vector sectionPosition; + World *world; + GLuint Vao, VboTextures, VboModels, VboColors; + std::vector models; + std::vector textures; + std::vector colors; + + static GLuint VboVertices, VboUvs; + static std::map refCounterVbo; + static std::map refCounterVao; + + size_t numOfFaces = 0; + + bool isEnabled = true; + + size_t hash = 0; +public: + RendererSection(World *world, Vector position); + RendererSection(const RendererSection &other); + ~RendererSection() override; + + void Render(RenderState &renderState) override; + + void PrepareResources() override; + + void PrepareRender() override; + + void SetEnabled(bool isEnabled); + + Section *GetSection(); + + bool IsNeedUpdate(); +}; \ No newline at end of file -- cgit v1.2.3