diff options
Diffstat (limited to 'include/graphics/RenderSection.hpp')
-rw-r--r-- | include/graphics/RenderSection.hpp | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/include/graphics/RenderSection.hpp b/include/graphics/RenderSection.hpp new file mode 100644 index 0000000..6a2f3ce --- /dev/null +++ b/include/graphics/RenderSection.hpp @@ -0,0 +1,41 @@ +#pragma once + +#include <GL/glew.h> +#include <glm/detail/type_mat.hpp> +#include <glm/vec2.hpp> +#include <glm/detail/type_mat4x4.hpp> +#include <glm/gtx/transform.hpp> +#include <easylogging++.h> + +#include <world/Section.hpp> +#include <world/World.hpp> + +class RenderState { + GLuint ActiveVao; + GLuint ActiveShader; +public: + void SetActiveVao(GLuint Vao); + void SetActiveShader(GLuint Shader); +}; + +class RenderSection { + Vector sectionPosition; + World *world; + GLuint Vao,VboBlocks,VboModels; + + static GLuint VboVertices,VboUvs; + static std::map<GLuint,int> refCounterVbo; + static std::map<GLuint,int> refCounterVao; + + size_t numOfBlocks; + +public: + RenderSection(World *world, Vector position); + RenderSection(const RenderSection &other); + ~RenderSection(); + + void UpdateState(); + void Render(RenderState &state); + + Section* GetSection(); +};
\ No newline at end of file |