]> git.tdb.fi Git - libs/gl.git/blobdiff - source/renderbuffer.cpp
Add EXT_framebuffer_blit and EXT_framebuffer_multisample
[libs/gl.git] / source / renderbuffer.cpp
index d28237bed7e33f55aa5ae7245c63e98707bb06e1..bd37aeea2bc59b460bbf17d4ecc32351bdfbe8dd 100644 (file)
@@ -1,11 +1,12 @@
 /* $Id$
 
 This file is part of libmspgl
-Copyright © 2007  Mikko Rasa, Mikkosoft Productions
+Copyright © 2007-2011  Mikko Rasa, Mikkosoft Productions
 Distributed under the LGPL
 */
 
 #include "extension.h"
+#include "ext_framebuffer_multisample.h"
 #include "ext_framebuffer_object.h"
 #include "renderbuffer.h"
 
@@ -32,6 +33,16 @@ void Renderbuffer::storage(PixelFormat fmt, unsigned w, unsigned h)
        glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, fmt, width, height);
 }
 
+void Renderbuffer::storage_multisample(unsigned samples, PixelFormat fmt, unsigned w, unsigned h)
+{
+       static RequireExtension _ext("GL_EXT_framebuffer_multisample");
+
+       Bind _bind(this, true);
+       width = w;
+       height = h;
+       glRenderbufferStorageMultisampleEXT(GL_RENDERBUFFER_EXT, samples, fmt, width, height);
+}
+
 void Renderbuffer::bind() const
 {
        if(set_current(this))