X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fbuffer.h;h=1d073ab7af35c77ae32a43068c71a79ecd21831f;hb=5172d32d67595ea0b70184fadcfcb8e023cccbc8;hp=7aea9665d8dd9a2ddaf77695891aa7c840a0810c;hpb=85c82f93f4874bcf0b04332c9abb62cd2a5b181b;p=libs%2Fgl.git diff --git a/source/buffer.h b/source/buffer.h index 7aea9665..1d073ab7 100644 --- a/source/buffer.h +++ b/source/buffer.h @@ -1,7 +1,7 @@ /* $Id$ This file is part of libmspgl -Copyright © 2007 Mikko Rasa, Mikkosoft Productions +Copyright © 2007, 2009-2010 Mikko Rasa, Mikkosoft Productions Distributed under the LGPL */ @@ -84,6 +84,23 @@ private: static void restore(const Buffer *, BufferType); }; +/** +An adaptor for Buffer to make it compatible with Bind. +*/ +template +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