#pragma once

#include "client/render/Camera.h"
#include "client/render/loader/GLLoader.h"
#include <memory>

namespace blitz {

namespace shader {

class EntityShader;
class WorldShader;

}  // namespace shader


class Client;

namespace render {

class MainRenderer {
  private:
	Client* m_Client;
	std::unique_ptr<GL::VertexArray> m_PlayerVao;
	std::unique_ptr<GL::VertexArray> m_WorldVao;
	std::unique_ptr<shader::EntityShader> m_EntityShader;
	std::unique_ptr<shader::WorldShader> m_WorldShader;
	Camera m_Camera;

  public:
	MainRenderer(Client* client);
	~MainRenderer();

	void Update();
	void Render();
	void RenderEntity(const GL::VertexArray& vao, const Vec3f& position, float yaw);
	void RenderWorld(const GL::VertexArray& vao);

  private:
	void LoadModels();
	void RenderPlayers();
	void RenderWorld();
	void UpdateCamera();
};

}  // namespace render
}  // namespace blitz
