Aether
SDL2 based UI Framework for NX
include
Aether
base
AsyncItem.hpp
1
#ifndef BASE_ASYNCITEM_HPP
2
#define BASE_ASYNCITEM_HPP
3
4
#include "Aether/base/Texture.hpp"
5
6
namespace
Aether
{
14
class
AsyncItem
:
public
Element
{
15
private
:
19
enum class
Status {
20
NotRendered,
21
Rendering,
22
Rendered
23
};
24
28
float
fadeAmount;
29
33
Status renderStatus;
34
38
std::vector<Texture *> textures;
39
47
virtual
bool
canRender();
48
54
virtual
int
fadeSpeed();
55
62
virtual
void
positionElements() = 0;
63
72
virtual
int
renderThreshold();
73
79
bool
withinThreshold();
80
81
protected
:
88
void
addTexture
(
Aether::Texture
* texture);
89
99
bool
removeTexture
(
Aether::Texture
* texture);
100
105
bool
ready
();
106
107
public
:
111
AsyncItem
();
112
117
void
update
(uint32_t dt);
118
125
void
setW
(
int
w
);
126
133
void
setH
(
int
h
);
134
};
135
};
136
137
#endif
Aether::AsyncItem::setW
void setW(int w)
Sets the width of the item, in pixels. Also calls updateElements() if textures are already rendered...
Aether::AsyncItem::addTexture
void addTexture(Aether::Texture *texture)
Adds the given texture to the item's monitoring list, causing it to be rendered/destroyed when needed...
Aether::AsyncItem::removeTexture
bool removeTexture(Aether::Texture *texture)
Removes the given texture from the item's monitoring list, causing it to no longer be handled by the ...
Aether::AsyncItem::update
void update(uint32_t dt)
Updates the state of child elements.
Aether::AsyncItem::setH
void setH(int h)
Sets the height of the item, in pixels. Also calls updateElements() if textures are already rendered...
Aether::Element::w
int w()
Returns width of element.
Aether::AsyncItem::ready
bool ready()
Returns whether the element has all it's textures rendered.
Aether::Texture
A Texture is an element that stores a texture to render in the window. It can't be instantiated alone...
Definition:
Texture.hpp:24
Aether::Element
Element is the base class to be inherited to form all other types of elements.
Definition:
Element.hpp:18
Aether::Element::h
int h()
Returns height of element.
Aether
Base namespace for all Aether related classes and functions.
Aether::AsyncItem
Abstract class which handles rendering child elements asynchronously based on the position of the ele...
Definition:
AsyncItem.hpp:14
Aether::AsyncItem::AsyncItem
AsyncItem()
Creates a new AsyncItem.
Generated by
1.8.13