-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRenderTexture.hpp
More file actions
35 lines (28 loc) · 942 Bytes
/
Copy pathRenderTexture.hpp
File metadata and controls
35 lines (28 loc) · 942 Bytes
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
#ifndef RENDERTEXTURE_HPP
#define RENDERTEXTURE_HPP
#include "Vector3.hpp"
enum class RTFilterMode {
Point,
Bilinear
};
class RenderTexture {
public:
RenderTexture(unsigned short width, unsigned short height, RTFilterMode filterMode);
RenderTexture(unsigned short width, unsigned short height);
RenderTexture(RTFilterMode filterMode);
RenderTexture();
unsigned short getWidth();
unsigned short getHeight();
void fill(unsigned short color);
bool writePixel(unsigned short i, unsigned short j, unsigned short color);
unsigned short sampleGBAColor(int i, int j);
Vector3 sampleVectorColor(int i, int j);
// Use only if 240x160 resolution guaranteed
void drawFullscreenUnsafe();
private:
unsigned short* buffer;
RTFilterMode filterMode;
unsigned short width;
unsigned short height;
};
#endif