31 lines
637 B
C++
31 lines
637 B
C++
#pragma once
|
|
|
|
class RTT
|
|
{
|
|
bool bound = false;
|
|
GLint oldFboID = 0;
|
|
GLuint fboID;
|
|
GLuint rboID;
|
|
GLuint texID;
|
|
int w;
|
|
int h;
|
|
|
|
public:
|
|
RTT();
|
|
~RTT();
|
|
|
|
void destroy();
|
|
bool create(int width, int height, int tex = -1);
|
|
void clear(glm::vec4 color = glm::vec4(0));
|
|
void readTextureData(uint8_t* buffer);
|
|
uint8_t* createBuffer();
|
|
void bindFramebuffer();
|
|
void unbindFramebuffer();
|
|
void bindTexture();
|
|
void unbindTexture();
|
|
GLuint getTextureID() { return texID; }
|
|
int getWidth() { return w; }
|
|
int getHeight() { return h; }
|
|
GLuint getFBO() { return fboID; }
|
|
};
|