holesome/src/game/world/world_view.h

32 lines
504 B
C
Raw Normal View History

2023-05-09 20:50:50 +02:00
#ifndef HOLESOME_WORLD_VIEW_H
#define HOLESOME_WORLD_VIEW_H
#include "../game_object.h"
#include "../game.h"
2023-05-10 11:03:14 +02:00
class WorldView : public GameObject
2023-05-09 20:50:50 +02:00
{
public:
2023-05-10 11:03:14 +02:00
explicit WorldView();
2023-05-09 20:50:50 +02:00
~WorldView();
void draw(sf::RenderWindow *window) const override;
2023-05-10 11:03:14 +02:00
void update(Game *game) override;
2023-05-09 20:50:50 +02:00
private:
2023-05-10 11:03:14 +02:00
sf::View *view;
bool hasViewChanged;
2023-05-10 11:03:14 +02:00
void initializeView(Game *game);
void setSize(sf::Vector2u windowSize);
void moveViewByControls();
2023-05-09 20:50:50 +02:00
};
#endif //HOLESOME_WORLD_VIEW_H