feat: switched to qt and refactored
This commit is contained in:
32
rendertarget.hpp
Normal file
32
rendertarget.hpp
Normal file
@@ -0,0 +1,32 @@
|
||||
|
||||
#ifndef RENDERTARGET_H
|
||||
#define RENDERTARGET_H
|
||||
|
||||
#include "fastmath.hpp"
|
||||
class Rendertarget {
|
||||
|
||||
public:
|
||||
const int width;
|
||||
const int height;
|
||||
|
||||
Rendertarget(int width, int height) : width(width), height(height) {
|
||||
pixels = new decimal[width * height * 3];
|
||||
}
|
||||
|
||||
void set(int x, int y, vec3 val) {
|
||||
int start = (width * y + x) * 3;
|
||||
for (int i = 0; i < 3; i++) {
|
||||
pixels[start + i] = val[i];
|
||||
}
|
||||
}
|
||||
void get(int x, int y, vec3 *val) {
|
||||
int start = (width * y + x) * 3;
|
||||
for (int i = 0; i < 3; i++) {
|
||||
(*val)[i] = pixels[start + i];
|
||||
}
|
||||
}
|
||||
|
||||
decimal *pixels;
|
||||
};
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user