-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathr_aa.h
57 lines (42 loc) · 895 Bytes
/
r_aa.h
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#ifndef R_AA_HDR
#define R_AA_HDR
#include "r_common.h"
#include "r_method.h"
namespace m {
struct mat4;
struct perspective;
}
namespace r {
struct aaMethod : method {
aaMethod();
bool init(const u::initializer_list<const char *> &defines = { });
void setWVP(const m::mat4 &wvp);
void setColorTextureUnit(int unit);
void setPerspective(const m::perspective &perspective);
private:
uniform *m_WVP;
uniform *m_colorMap;
uniform *m_screenSize;
};
inline aaMethod::aaMethod()
: m_WVP(nullptr)
, m_colorMap(nullptr)
, m_screenSize(nullptr)
{
}
struct aa {
aa();
~aa();
bool init(const m::perspective &p);
void update(const m::perspective &p);
void bindWriting();
GLuint texture() const;
private:
void destroy();
GLuint m_fbo;
GLuint m_texture;
size_t m_width;
size_t m_height;
};
}
#endif