aboutsummaryrefslogtreecommitdiffstats
path: root/ui/label.hpp
blob: 9524007029a2a6557966d797fe09068139481bb5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#ifndef MBUOY_UI_LABEL_HPP
#define MBUOY_UI_LABEL_HPP

#include "attr/position.hpp"
#include "attr/string.hpp"
#include "find.hpp"
#include "port.hpp"

namespace mbuoy {

template<auto... Attr>
struct label
{
    static constexpr auto point = find<position>(Attr...);
    static constexpr auto text = find<const char *>(Attr...);

    static consteval void init(unsigned char *(&ptr)) {
    }

    static void render() {
        port::puts(point->x, point->y, *text);
    }

    static consteval int size() {
        return 0;
    }
};

} // namespace mbuoy

#endif // MBUOY_UI_LABEL_HPP