2 #include "ext_framebuffer_multisample.h"
3 #include "ext_framebuffer_object.h"
4 #include "renderbuffer.h"
9 Renderbuffer::Renderbuffer()
11 static RequireExtension _ext("GL_EXT_framebuffer_object");
13 glGenRenderbuffersEXT(1, &id);
16 Renderbuffer::~Renderbuffer()
18 glDeleteRenderbuffersEXT(1, &id);
21 void Renderbuffer::storage(PixelFormat fmt, unsigned wd, unsigned ht)
23 Bind _bind(this, true);
26 glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, fmt, width, height);
29 void Renderbuffer::storage_multisample(unsigned samples, PixelFormat fmt, unsigned wd, unsigned ht)
31 static RequireExtension _ext("GL_EXT_framebuffer_multisample");
33 Bind _bind(this, true);
36 glRenderbufferStorageMultisampleEXT(GL_RENDERBUFFER_EXT, samples, fmt, width, height);
39 void Renderbuffer::bind() const
42 glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, id);
45 void Renderbuffer::unbind()
48 glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, 0);