NasNas
An intuitive and beginner friendly 2D game framework for C++
GraphicsComponent.hpp
1 // Created by Modar Nasser on 10/06/2020.
2 
3 #pragma once
4 
5 #include <SFML/Graphics/Drawable.hpp>
6 #include <SFML/Graphics/Transform.hpp>
7 
8 #include <NasNas/core/data/Rect.hpp>
9 
10 namespace ns::ecs {
11 
12  class GraphicsComponent : public sf::Drawable {
13  public:
14  ~GraphicsComponent() override = default;
15  virtual auto getDrawable() -> sf::Drawable& = 0;
16  virtual auto getGlobalBounds() -> ns::FloatRect = 0;
17  virtual void update() = 0;
18 
19  protected:
20  sf::Transform m_transform;
21  };
22 
24 }