1 #ifndef AETHER_WINDOW_HPP 2 #define AETHER_WINDOW_HPP 9 typedef std::function<void(const std::string, const bool)> LogHandler;
42 enum class FadeAction {
69 std::function<Colour(uint32_t)> highlight;
71 std::vector<Overlay *> overlays;
72 std::queue< std::pair<ScreenOperation, Screen *> > screenOps;
73 std::stack<Screen *> screenStack;
80 void performScreenOps();
92 void renderDebug(
const double delta);
99 void renderFade(
const double delta);
106 void updateHeldButton(
const double delta);
113 void updateOverlays(
const double delta);
126 Window(
const std::string & name,
const unsigned int width,
const unsigned int height,
const LogHandler & log);
173 void setFont(
const std::string & path);
void setFont(const std::string &path)
Set a custom font to use for text rendering. Pass an empty string to revert back to internal fonts...
void setFadeIn(const bool fade)
Enable a fade in animation.
void addOverlay(Overlay *ovl)
Add the given overlay to the window, placing it on top of existing ones.
void exit()
Stop the main loop().
void setBackgroundColour(const Colour &col)
Set the colour used to clear the screen between frames. The alpha channel is ignored.
Small utility class to measure time.
Definition: Timer.hpp:10
void showDebugInfo(const bool show)
Set whether debugging information is shown.
~Window()
Cleans up Aether.
void setHighlightBackground(const Colour &col)
Set the background colour used for highlighting an element.
A class that represents a screen layout Stores all screen elements for a specific screen...
Definition: Screen.hpp:12
void showScreen(Screen *screen)
Set the screen to show (takes effect at next loop). Ths does not alter the screen stack in anyway; it...
ScreenOperation
Types of operations to perform on the screen stack.
Definition: Window.hpp:32
void setHighlightOverlay(const Colour &col)
Set the colour used to highlight an element when selected.
Stores RGBA values representing a colour. Each component can be within the range 0 to 255 (inclusive)...
Definition: Colour.hpp:9
Stores either a surface or texture which can be drawn on screen by providing a renderer to render()...
Definition: Drawable.hpp:22
void pushScreen()
Push the current screen onto the stack at the next loop.
Base namespace for all Aether related classes and functions.
bool loop()
Handles rendering the current screen and events. This should be called until it returns false...
void setHighlightAnimation(const std::function< Colour(const uint32_t)> &func)
Set the function used to animate the highlight border.
bool setBackgroundImage(const std::string &path)
Set an image to use as the background. Pass an empty string to remove.
void setFontSpacing(const double spacing)
Set the spacing between wrapped lines of text.
void popScreen()
Pop a screen from the stack at the next loop.
void setHoldDelay(const int ms)
Set the time to wait before firing duplicate button events due to a button being held down...
Window(const std::string &name, const unsigned int width, const unsigned int height, const LogHandler &log)
Initializes an Aether instance. There should only ever be one Window instantiated at once (ideally on...
void removeScreen()
Remove the screen set with showScreen() immediately from the window. This does not wait until the nex...
An object representing an overlay.
Definition: Overlay.hpp:14
void setFadeOut(const bool fade)
Enable a fade out animation.
The Window is the root element, which initializes Aether and contains all of the screens/elements to ...
Definition: Window.hpp:27
Button
Enum class for buttons Avoids confusion with SDL/libnx names.
Definition: Types.hpp:12
int holdDelay()
Returns the current value for 'hold delay' (see setHoldDelay()).