mirror of
https://github.com/J-D-K/JKSV.git
synced 2026-03-22 01:34:13 -05:00
26 lines
850 B
C++
26 lines
850 B
C++
#pragma once
|
|
#include "sdl.hpp"
|
|
|
|
namespace ui
|
|
{
|
|
/// @brief Base class for ui elements.
|
|
class Element
|
|
{
|
|
public:
|
|
/// @brief Default constructor.
|
|
Element() = default;
|
|
|
|
/// @brief Virtual destructor.
|
|
virtual ~Element() noexcept {};
|
|
|
|
/// @brief Virtual update method. All derived classes must have this.
|
|
/// @param HasFocus Whether or not the state containing the element currently has focus.
|
|
virtual void update(bool HasFocus) = 0;
|
|
|
|
/// @brief Virtual render method. All derived classes must have this.
|
|
/// @param target Target to render to.
|
|
/// @param hasFocus Whether or not the containing state has focus.
|
|
virtual void render(sdl::SharedTexture &target, bool hasFocus) = 0;
|
|
};
|
|
} // namespace ui
|