16 bool renderEveryFrame;
27 void draw()
const override;
29 void update(time_t time_ms)
override;
54 DERIVE_EVENT_HANDLERS(
Image)
Display an arbitrary (non-animated) renderable to the screen with an optional shader.
Definition image.hpp:12
void draw() const override
Render the widget to the screen.
void setShader(const shader_oneframe_t &shader)
Set the image shader to one that only requires rendering once.
void setRender(const Renderable &renderable)
Change the current rendered object.
void update(time_t time_ms) override
Update any internal state of the widget, and check if it needs to be re-rendered.
void removeShader()
Remove the shader from the image, if any exists.
Size size() const override
Get the size of the widget.
void setShader(const shader_animated_t &shader)
Set the image shader to a new one that requires re-rendering every frame.
Image(const Renderable &renderable, const Position &pos={0, 0}, const Alignment &align={ALIGN_LEFT, ALIGN_TOP})
Construct an image from some renderable data.
std::function< color_t(color_t color, const Coords &coords, const Size &size, time_t time)> shader_animated_t
A pixel shader that may update based on the current time.
Definition renderable.hpp:35
shader_animated_t shader_t
A pixel shader that may or may not update based on the current time.
Definition renderable.hpp:48
std::function< color_t(color_t color, const Coords &coords, const Size &size)> shader_oneframe_t
A pixel shader that's independent of the current time.
Definition renderable.hpp:22
A struct that holds a widget's vertical and horizontal alignment.
Definition alignment.hpp:22
A struct that holds the normalized position of a widget.
Definition position.hpp:15
An abstract interface for arbitrary renderable objects.
Definition renderable.hpp:55
A struct that holds the number of pixels that a widget would take up on the screen.
Definition size.hpp:17