OGLplus (0.52.0) a C++ wrapper for OpenGL

auto_rebind.hpp
Go to the documentation of this file.
1 
12 #pragma once
13 #ifndef OGLPLUS_OBJECT_AUTO_REBIND_1107121519_HPP
14 #define OGLPLUS_OBJECT_AUTO_REBIND_1107121519_HPP
15 
17 
18 namespace oglplus {
19 
20 template <typename Object>
21 class AutoRebind;
22 
24 template <typename OpsTag, typename ObjTag>
25 class AutoRebind<Object<ObjectOps<OpsTag, ObjTag>>>
26 {
27 private:
28  typedef typename ObjectOps<OpsTag, ObjTag>::Target Target;
29  ObjectName<ObjTag> _object;
30  Target _target;
31 public:
33  AutoRebind(Target target)
34  : _object(ObjBindingOps<ObjTag>::Binding(target))
35  , _target(target)
36  { }
37 
40  {
41  ObjBindingOps<ObjTag>::Bind(_target, _object);
42  }
43 };
44 
45 } // namespace oglplus
46 
47 #endif // include guard
~AutoRebind(void)
Re-binds the object to the target specified in constructor.
Definition: auto_rebind.hpp:39
AutoRebind(Target target)
Remembers the object currently bound to target.
Definition: auto_rebind.hpp:33
Generic OpenGL object wrapper.
Implements operations applicable to named (non-zero) objects.
Definition: wrap_tpl.hpp:45
A common template for "named" objects like textures, buffers, etc.
Definition: fwd.hpp:136

Copyright © 2010-2014 Matúš Chochlík, University of Žilina, Žilina, Slovakia.
<matus.chochlik -at- fri.uniza.sk>
<chochlik -at -gmail.com>
Documentation generated on Mon Sep 22 2014 by Doxygen (version 1.8.6).