mirror of
https://github.com/J-D-K/JKSV.git
synced 2026-03-27 03:54:31 -05:00
26 lines
834 B
C++
26 lines
834 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() {};
|
|
|
|
/// @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_Texture *target, bool hasFocus) = 0;
|
|
};
|
|
} // namespace ui
|