From c5697e42a76142c339806e1c0bc7ed15e3ace548 Mon Sep 17 00:00:00 2001 From: vimene Date: Sun, 19 Nov 2023 23:25:06 +0100 Subject: started switching to autotools --- src/pixfb.h | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 src/pixfb.h (limited to 'src/pixfb.h') diff --git a/src/pixfb.h b/src/pixfb.h new file mode 100644 index 0000000..c54b5fb --- /dev/null +++ b/src/pixfb.h @@ -0,0 +1,29 @@ +#ifndef PIXFB_H +#define PIXFB_H + +#include +#include +#include "math_vector.h" +#include "tri_vertex.h" + +class PixelFrameBuffer { + public: + PixelFrameBuffer(unsigned int w, unsigned int h); + void resize(unsigned int w, unsigned int h); + unsigned int width() const; + unsigned int height() const; + const uint32_t* pixels() const; + void clear(); + void draw_triangle(TriangleVertex4 triangle); + + private: + unsigned int w, h; + std::vector pixels_vector; + std::vector depth_buf; + int face_ind; + + void _draw_cropped_triangle(TriangleVertex3 triangle); + uint32_t face_color() const; +}; + +#endif // PIXFB_H -- cgit v1.2.3