aboutsummaryrefslogtreecommitdiff
path: root/src/fb/chfb.hpp
blob: b076f7db7edb0e1e5cf97c96c26d7155e41ab39e (plain) (blame)
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
33
34
35
#ifndef FB_CHFB_HPP
#define FB_CHFB_HPP

#include <vector>
#include "math/vector.hpp"

namespace engine::fb {

class CharacterFrameBuffer {
    public:
        CharacterFrameBuffer(unsigned int w, unsigned int h);
        void resize(unsigned int w, unsigned int h);
        void clear();
        void draw_point(int x, int y, const engine::math::Vector4& point);

        constexpr unsigned int width() const & {
            return w;
        }

        constexpr unsigned int height() const & {
            return h;
        }

        constexpr const char* chars() const & {
            return chars_vector.data();
        }

    private:
        unsigned int w, h;
        std::vector<char> chars_vector;
};

}

#endif // FB_CHFB_HPP