31 lines
534 B
C++
31 lines
534 B
C++
#ifndef FRAMEBUFFER_H
|
|
#define FRAMEBUFFER_H
|
|
|
|
#include <glew/glew.h>
|
|
#include <vector>
|
|
|
|
class Texture;
|
|
|
|
class FrameBuffer
|
|
{
|
|
private:
|
|
FrameBuffer(int id) : fbo(id) {}
|
|
|
|
protected:
|
|
GLuint fbo;
|
|
std::vector<Texture*> textures;
|
|
std::vector<GLuint> attachments;
|
|
|
|
public:
|
|
FrameBuffer();
|
|
~FrameBuffer();
|
|
void addTexture(Texture* tex, GLenum attachment);
|
|
void initColorAttachments();
|
|
|
|
void bindFBO() const;
|
|
Texture* getTexture(int texId);
|
|
static const FrameBuffer* screen;
|
|
};
|
|
|
|
#endif // FRAMEBUFFER_H
|