#pragma once

#include "client/render/Camera.h"
#include "client/render/loader/GLLoader.h"
#include "client/render/loader/ModelLoader.h"

namespace blitz {

namespace shader {

class EntityShader;
class WorldShader;

}  // namespace shader


class Client;

namespace render {

class MainRenderer {
  private:
	Client* m_Client;
	ModelLoader::Model m_PlayerModel;
	ModelLoader::Model m_WorldModel;
	std::unique_ptr<shader::EntityShader> m_EntityShader;
	std::unique_ptr<shader::WorldShader> m_WorldShader;
	unsigned int m_Texture;
	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
