aboutsummaryrefslogtreecommitdiff
path: root/src/fb/pixfb.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/fb/pixfb.h')
-rw-r--r--src/fb/pixfb.h26
1 files changed, 18 insertions, 8 deletions
diff --git a/src/fb/pixfb.h b/src/fb/pixfb.h
index 84bce2c..81a7ac3 100644
--- a/src/fb/pixfb.h
+++ b/src/fb/pixfb.h
@@ -3,26 +3,36 @@
#include <vector>
#include <cstdint>
-#include "fb/fb.h"
+#include "math/vector.h"
+#include "o3d/vertex_data.h"
namespace engine::fb {
-class PixelFrameBuffer : public FrameBuffer {
+using engine::math::Vector3, engine::o3d::VertexData;
+
+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_point(int x, int y, engine::math::Vector3 loc, const engine::o3d::VertexData& vd);
+ 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 uint32_t* pixels() const & {
+ return pixels_vector.data();
+ }
private:
unsigned int w, h;
std::vector<uint32_t> pixels_vector;
int face_ind;
-
- uint32_t face_color(int face_ind) const;
};
}