aboutsummaryrefslogtreecommitdiff
path: root/src/fb/chfb.h
blob: a866feff761c9b308a1c5241181b4c1fb591b878 (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
36
37
38
#ifndef FB_CHFB_H
#define FB_CHFB_H

#include <vector>
#include "math/vector.h"
#include "o3d/vertex_data.h"

namespace engine::fb {

using engine::math::Vector3, engine::o3d::VertexData;

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 Vector3& loc, const VertexData& vd, const Vector3& normal);

        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_H