]> git.tdb.fi Git - libs/gl.git/blobdiff - source/renderbuffer.cpp
Get all blocks for the program before applying them
[libs/gl.git] / source / renderbuffer.cpp
index d28237bed7e33f55aa5ae7245c63e98707bb06e1..240cf84c7a7285926c7ff8b6e14aa44f8c7c221c 100644 (file)
@@ -1,11 +1,5 @@
-/* $Id$
-
-This file is part of libmspgl
-Copyright © 2007  Mikko Rasa, Mikkosoft Productions
-Distributed under the LGPL
-*/
-
 #include "extension.h"
+#include "ext_framebuffer_multisample.h"
 #include "ext_framebuffer_object.h"
 #include "renderbuffer.h"
 
@@ -24,14 +18,24 @@ Renderbuffer::~Renderbuffer()
        glDeleteRenderbuffersEXT(1, &id);
 }
 
-void Renderbuffer::storage(PixelFormat fmt, unsigned w, unsigned h)
+void Renderbuffer::storage(PixelFormat fmt, unsigned wd, unsigned ht)
 {
        Bind _bind(this, true);
-       width = w;
-       height = h;
+       width = wd;
+       height = ht;
        glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, fmt, width, height);
 }
 
+void Renderbuffer::storage_multisample(unsigned samples, PixelFormat fmt, unsigned wd, unsigned ht)
+{
+       static RequireExtension _ext("GL_EXT_framebuffer_multisample");
+
+       Bind _bind(this, true);
+       width = wd;
+       height = ht;
+       glRenderbufferStorageMultisampleEXT(GL_RENDERBUFFER_EXT, samples, fmt, width, height);
+}
+
 void Renderbuffer::bind() const
 {
        if(set_current(this))