le2d v0.4.8
2D game engine framework
 
Loading...
Searching...
No Matches
terminal.hpp
Go to the documentation of this file.
1#pragma once
3#include "le2d/event.hpp"
6#include <klib/concepts.hpp>
7#include <kvf/time.hpp>
8#include <cstdint>
9#include <string_view>
10
11namespace le::console {
12enum class StateChange : std::int8_t { None, Activated, Deactivated };
13
14class ITerminal : public IDrawable, public tweak::IStore {
15 public:
16 [[nodiscard]] virtual auto is_null() const -> bool = 0;
17
18 [[nodiscard]] virtual auto is_active() const -> bool = 0;
19 virtual void toggle_active() = 0;
20
21 virtual void println(std::string_view text) = 0;
22 virtual void printerr(std::string_view text) = 0;
23
24 [[nodiscard]] virtual auto get_background() const -> kvf::Color = 0;
25 virtual void set_background(kvf::Color color) = 0;
26
27 virtual auto handle_events(glm::vec2 framebuffer_size, std::span<Event const> events) -> StateChange = 0;
28
29 virtual void tick(kvf::Seconds dt) = 0;
30};
31} // namespace le::console
Interface for drawable types.
Definition drawable.hpp:6
Definition terminal.hpp:14
virtual void set_background(kvf::Color color)=0
virtual void printerr(std::string_view text)=0
virtual void tick(kvf::Seconds dt)=0
virtual auto get_background() const -> kvf::Color=0
virtual void println(std::string_view text)=0
virtual void toggle_active()=0
virtual auto is_active() const -> bool=0
virtual auto handle_events(glm::vec2 framebuffer_size, std::span< Event const > events) -> StateChange=0
virtual auto is_null() const -> bool=0
Definition store.hpp:7
Definition texture.hpp:9
Definition junction.hpp:6
StateChange
Definition terminal.hpp:12
event::Event Event
Definition event.hpp:67