diff options
| author | vimene <vincent.menegaux@gmail.com> | 2025-12-10 20:40:42 +0100 |
|---|---|---|
| committer | vimene <vincent.menegaux@gmail.com> | 2025-12-10 20:40:42 +0100 |
| commit | 761604f9e4815e8f4355637ebb46052314cbed86 (patch) | |
| tree | b9cd6dde75ebf5897f8e67835522c6411d6ab7cb /src/fb/chfb.hpp | |
| parent | c666035bc6a51e4dd76daebefffaf8bbc951977c (diff) | |
| download | engine-761604f9e4815e8f4355637ebb46052314cbed86.tar.gz | |
renamed .h to .hpp
Diffstat (limited to 'src/fb/chfb.hpp')
| -rw-r--r-- | src/fb/chfb.hpp | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/src/fb/chfb.hpp b/src/fb/chfb.hpp new file mode 100644 index 0000000..8e47d6b --- /dev/null +++ b/src/fb/chfb.hpp @@ -0,0 +1,38 @@ +#ifndef FB_CHFB_H +#define FB_CHFB_H + +#include <vector> +#include "math/vector.hpp" +#include "o3d/vertex_data.hpp" + +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 |
