]> git.tdb.fi Git - libs/gl.git/blobdiff - source/buffer.h
Drop Id tags and copyright notices from files
[libs/gl.git] / source / buffer.h
index 7aea9665d8dd9a2ddaf77695891aa7c840a0810c..5e3cd29a4162c124a3b259f419cd9a558760d3db 100644 (file)
@@ -1,10 +1,3 @@
-/* $Id$
-
-This file is part of libmspgl
-Copyright © 2007  Mikko Rasa, Mikkosoft Productions
-Distributed under the LGPL
-*/
-
 #ifndef MSP_GL_BUFFER_H_
 #define MSP_GL_BUFFER_H_
 
@@ -84,6 +77,23 @@ private:
        static void restore(const Buffer *, BufferType);
 };
 
+/**
+An adaptor for Buffer to make it compatible with Bind.
+*/
+template<BufferType T>
+class BufferAlias
+{
+private:
+       const Buffer &buffer;
+
+public:
+       BufferAlias(const Buffer &b): buffer(b) { }
+
+       void bind() const { buffer.bind_to(T); }
+       static const Buffer *current() { return Buffer::current(T); }
+       static void unbind() { Buffer::unbind_from(T); }
+};
+
 } // namespace GL
 } // namespace Msp