glDeleteRenderbuffers(1, &id);
}
+PixelFormat Renderbuffer::normalize_format(PixelFormat fmt)
+{
+ if(!get_component_size(fmt) && MSP_sized_internal_formats)
+ {
+ unsigned size = (fmt==DEPTH_COMPONENT ? get_gl_api()==OPENGL_ES2 ? 2 : 4 : 1);
+ return get_sized_pixelformat(fmt, size);
+ }
+
+ return fmt;
+}
+
void Renderbuffer::storage(PixelFormat fmt, unsigned wd, unsigned ht)
{
+ fmt = normalize_format(fmt);
require_pixelformat(fmt);
width = wd;
height = ht;
void Renderbuffer::storage_multisample(unsigned samples, PixelFormat fmt, unsigned wd, unsigned ht)
{
static Require _req(EXT_framebuffer_multisample);
+ fmt = normalize_format(fmt);
require_pixelformat(fmt);
width = wd;
unsigned get_width() const { return width; }
unsigned get_height() const { return height; }
+private:
+ static PixelFormat normalize_format(PixelFormat);
+
+public:
/** Allocates storage for the renderbuffer. */
void storage(PixelFormat fmt, unsigned wd, unsigned ht);