change WorldRenderer to class
This commit is contained in:
@@ -1,23 +1,39 @@
|
||||
#pragma once
|
||||
|
||||
#include "game/World.h"
|
||||
#include "render/loader/GLLoader.h"
|
||||
|
||||
#include <glm/glm.hpp>
|
||||
|
||||
namespace td {
|
||||
namespace render {
|
||||
|
||||
namespace WorldRenderer{
|
||||
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 init(const game::World* world);
|
||||
void update();
|
||||
void render();
|
||||
void destroy();
|
||||
void loadModels();
|
||||
|
||||
void moveCam(float relativeX, float relativeY, float aspectRatio);
|
||||
void changeZoom(float zoom);
|
||||
void click(int mouseX, int mouseY);
|
||||
|
||||
} // namespace WorldRenderer
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user