-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRBOMultisample.cpp
More file actions
53 lines (40 loc) · 1.35 KB
/
RBOMultisample.cpp
File metadata and controls
53 lines (40 loc) · 1.35 KB
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
#include "RBOMultisample.h"
#ifdef GL_API_GLAD_OPENGL_3
RBOMultisample::RBOMultisample(GLenum type, GLsizei width, GLsizei height, GLsizei samples) {
Init(type, width, height, samples);
}
RBOMultisample::~RBOMultisample() {
Delete();
}
void RBOMultisample::Init(GLenum type, GLsizei width, GLsizei height, GLsizei samples) {
Init(&ID, type, width, height, samples, &this->width, &this->height);
}
void RBOMultisample::Init(GLuint* ID, GLenum type, GLsizei width, GLsizei height, GLsizei samples, GLsizei* widthVar, GLsizei* heightVar) {
glGenRenderbuffers(1, ID);
Bind(*ID);
Data(type, width, height, samples, widthVar, heightVar);
}
void RBOMultisample::Data(GLenum type, GLsizei width, GLsizei height, GLsizei samples) {
Data(type, width, height, samples, &this->width, &this->height);
}
void RBOMultisample::Data(GLenum type, GLsizei width, GLsizei height, GLsizei samples, GLsizei* widthVar, GLsizei* heightVar) {
*widthVar = width;
*heightVar = height;
glRenderbufferStorageMultisample(bufferType, samples, type, width, height);
}
void RBOMultisample::Bind() {
Bind(ID);
}
void RBOMultisample::Bind(GLuint ID) {
glBindRenderbuffer(bufferType, ID);
}
void RBOMultisample::Unbind() {
glBindRenderbuffer(bufferType, 0);
}
void RBOMultisample::Delete() {
Delete(&ID);
}
void RBOMultisample::Delete(GLuint* ID) {
glDeleteRenderbuffers(1, ID);
}
#endif