blob: d341b10ff6cb34a492f3230e422bfd9017a2ee67 (
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
|
#ifndef FB_PIXFB_HPP
#define FB_PIXFB_HPP
#include <vector>
#include <cstdint>
#include "math/vector.hpp"
namespace engine::fb {
class PixelFrameBuffer {
public:
PixelFrameBuffer(unsigned int w, unsigned int h);
void resize(unsigned int w, unsigned int h);
void clear();
void draw_point(int x, int y, const engine::math::Vector4& point);
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;
};
}
#endif // FB_PIXFB_HPP
|