#ifndef FB_PIXFB_H #define FB_PIXFB_H #include #include #include "math/math_vector.h" #include "o3d/tri_vertex.h" namespace engine::fb { 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(engine::o3d::TriangleVertex4 triangle); private: unsigned int w, h; std::vector pixels_vector; std::vector depth_buf; int face_ind; void _draw_cropped_triangle(engine::o3d::TriangleVertex3 triangle); uint32_t face_color() const; }; } #endif // FB_PIXFB_H