40 lines
790 B
C++
40 lines
790 B
C++
#pragma once
|
|
|
|
#include "game/World.h"
|
|
#include "render/loader/GLLoader.h"
|
|
|
|
#include <glm/glm.hpp>
|
|
|
|
namespace td {
|
|
namespace render {
|
|
|
|
class WorldRenderer{
|
|
private:
|
|
game::World* m_World;
|
|
std::unique_ptr<GL::VAO> m_WorldVao, m_MobVao;
|
|
glm::vec2 m_CamPos;
|
|
float m_Zoom = 1;
|
|
float m_CamSensibility = 1;
|
|
public:
|
|
WorldRenderer(game::World* world);
|
|
~WorldRenderer();
|
|
|
|
void loadModels();
|
|
|
|
void update();
|
|
void render() const;
|
|
|
|
void setCamPos(float camX, float camY);
|
|
|
|
void moveCam(float relativeX, float relativeY, float aspectRatio);
|
|
void changeZoom(float zoom);
|
|
void click(int mouseX, int mouseY);
|
|
private:
|
|
void renderWorld() const;
|
|
void renderTowers() const;
|
|
void renderMobs() const;
|
|
};
|
|
|
|
} // namespace render
|
|
} // namespace td
|