forked from mravella/hair
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathframebuffer.h
42 lines (25 loc) · 956 Bytes
/
framebuffer.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
#ifndef FRAMEBUFFER_H
#define FRAMEBUFFER_H
#include "hairCommon.h"
class Texture;
class Framebuffer
{
public:
virtual ~Framebuffer();
void create();
void bind(GLenum target = GL_FRAMEBUFFER);
void unbind(GLenum target = GL_FRAMEBUFFER);
void attachColorTexture(GLuint textureID, GLenum target = GL_FRAMEBUFFER);
void attachColorTextures(std::vector<GLuint> textureIDs, GLenum target = GL_FRAMEBUFFER);
void attachDepthTexture(GLuint textureID, GLenum target = GL_FRAMEBUFFER);
void generateColorTexture(int width, int height, GLint magFilter, GLint minFilter);
void generateDepthTexture(int width, int height, GLint magFilter, GLint minFilter);
void generateDepthBuffer(int width, int height);
void resizeDepthBuffer(int width, int height);
Texture *colorTexture = NULL;
Texture *depthTexture = NULL;
private:
GLuint m_id;
GLuint m_depthBufferID = 0;
};
#endif // FRAMEBUFFER_H