mirror of
https://github.com/bailwillharr/engine.git
synced 2024-09-21 04:51:18 +00:00
26 lines
538 B
C++
26 lines
538 B
C++
#ifndef ENGINE_INCLUDE_COMPONENTS_RENDERABLE_TEXT_H_
|
|
#define ENGINE_INCLUDE_COMPONENTS_RENDERABLE_TEXT_H_
|
|
|
|
#include <memory>
|
|
#include <string>
|
|
|
|
#include "resources/texture.h"
|
|
|
|
namespace engine {
|
|
|
|
struct RenderableTextComponent {
|
|
void SetText(const std::string& text) {
|
|
text_ = text;
|
|
invalidated_ = true;
|
|
}
|
|
|
|
private:
|
|
std::string text_{"hello world"};
|
|
bool invalidated_ =
|
|
true; // text has been changed, texture must be regenerated
|
|
std::unique_ptr<resources::Texture> texture_{};
|
|
};
|
|
|
|
} // namespace engine
|
|
|
|
#endif |