10 glGenFramebuffers(1, &
id);
15 glDeleteFramebuffers(1, &
id);
18 id = GL_INVALID_INDEX;
23 glBindFramebuffer(GL_FRAMEBUFFER,
id);
24 int status = glCheckFramebufferStatus(GL_FRAMEBUFFER);
25 if (status != GL_FRAMEBUFFER_COMPLETE)
36 glGetIntegerv(GL_FRAMEBUFFER_BINDING, &fbo);
42 glBindFramebuffer(GL_FRAMEBUFFER,
id);
43 glClearColor(r, g, b, a);
44 glClear(GL_COLOR_BUFFER_BIT);
49 glBindFramebuffer(GL_FRAMEBUFFER,
id);
51 glClear(GL_DEPTH_BUFFER_BIT);
56 glBindFramebuffer(target,
id);
61 glBindFramebuffer(GL_FRAMEBUFFER, 0);
66 glFramebufferTexture2D(GL_FRAMEBUFFER, attachment, tex->
target, tex->
id, level);
72 glBindFramebuffer(GL_FRAMEBUFFER,
id);
73 glDrawBuffers(count, buffers);
void setTexture(unsigned int attachment, const Texture *tex, int level=0)
void bind(unsigned int target=0x8CA9)
void drawBuffers(int count, const unsigned int *buffers)
static unsigned int current()
void clearColor(float r=0.f, float g=0.f, float b=0.f, float a=1.f)
void clearDepth(float depth=1.f)
This is an implementation of AdditiveCCD based on peridyno.