X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=blobdiff_plain;f=source%2Fbindable.h;h=8823de5c9773209a1642f5b763887e65ca7ea5d6;hp=d85ec78daac037710390a7949c1deb164c3dbb51;hb=f14435e58bfa0fa697a06ba9a454bb30cd37d9d8;hpb=42ace9ac1350d3ae009bdd2fb335ac1e57d1b36b diff --git a/source/bindable.h b/source/bindable.h index d85ec78d..8823de5c 100644 --- a/source/bindable.h +++ b/source/bindable.h @@ -1,10 +1,3 @@ -/* $Id$ - -This file is part of libmspgl -Copyright © 2010 Mikko Rasa, Mikkosoft Productions -Distributed under the LGPL -*/ - #ifndef MSP_GL_BINDABLE_H_ #define MSP_GL_BINDABLE_H_ @@ -98,11 +91,21 @@ private: Base *binder; public: + template + Bind(const T &o, bool r = false): + binder(r ? create(&o, T::current()) : create(&o)) + { } + template Bind(const T *o, bool r = false): binder(r ? create(o, T::current()) : create(o)) { } + template + Bind(T *o, bool r = false): + binder(r ? create(o, T::current()) : create(o)) + { } + private: Bind(const Bind &); Bind &operator=(const Bind &);