#pragma once #include #include #include #include #include #include #include #include #include class RenderState { GLuint ActiveVao; GLuint ActiveShader; public: void SetActiveVao(GLuint Vao); void SetActiveShader(GLuint Shader); }; class RenderSection { 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: RenderSection(World *world, Vector position); RenderSection(const RenderSection &other); ~RenderSection(); void UpdateState(const std::map &textureAtlas); void Render(RenderState &state); void SetEnabled(bool isEnabled); Section *GetSection(); bool IsNeedUpdate(); };