#ifndef POLYGUN_ENGINE_CHUNK_RENDERER_HPP
#define POLYGUN_ENGINE_CHUNK_RENDERER_HPP

#include "chunk.hpp"
#include "engine.hpp"

namespace polygun::engine {
	class ChunkRenderer {
		public:
			ChunkRenderer(Chunk *chunk_to_render);
			~ChunkRenderer();
			
			void update_chunk(Chunk *chunk_to_render);
			void render(Camera camera);
		private:
			void load_textures();
			void generate_mesh();

			renderer::Shader m_chunk_shader;
			unsigned int m_vbo, m_vao;
			unsigned int m_textures[sizeof(nodes)];
			unsigned int m_texture1;
			float m_vertices[32768];
			Chunk *m_chunk;
	};
}

#endif //POLYGUN_ENGINE_CHUNK_RENDERER_HPP