SDL Breakout Engine  0.1.0
An implementation of a Breakout game using sdl, implemented with efficient resource management.
BasicText.hpp
Go to the documentation of this file.
1 #ifndef BASICTEXT_HPP
2 #define BASICTEXT_HPP
3 #include <ResourceManager.hpp>
4 
9 class BasicText
10 {
11 public:
20  BasicText(SDL_Point position, SDL_Renderer *renderer, std::shared_ptr<TTF_Font> font, SDL_Color& color);
21  ~BasicText();
27  void SetText(const std::wstring &text);
31  void Draw();
35  SDL_Rect TextDims();
36  BasicText(BasicText& text) = delete;
37 
38 private:
39  SDL_Renderer *renderer;
40  std::shared_ptr<TTF_Font> font;
41  SDL_Color color;
42  SDL_Surface *surface{};
43  SDL_Texture *texture{};
44  SDL_Rect rect{};
45 };
46 
47 #endif
SDL_Rect TextDims()
Definition: BasicText.cpp:48
void Draw()
Definition: BasicText.cpp:53
BasicText(SDL_Point position, SDL_Renderer *renderer, std::shared_ptr< TTF_Font > font, SDL_Color &color)
Definition: BasicText.cpp:10
~BasicText()
clean up a text object
Definition: BasicText.cpp:27
Definition: BasicText.hpp:9
void SetText(const std::wstring &text)
Definition: BasicText.cpp:33