OGLplus (0.52.0) a C++ wrapper for OpenGL

object_binding.hpp
Go to the documentation of this file.
1 
12 #pragma once
13 #ifndef OGLPLUS_CONTEXT_OBJECT_BINDING_1404142131_HPP
14 #define OGLPLUS_CONTEXT_OBJECT_BINDING_1404142131_HPP
15 
17 
18 namespace oglplus {
19 namespace context {
20 
21 
23 
27 {
28 public:
30 
36  template <typename Object>
37  static void Bind(typename Object::Target target, const Object& object)
38  {
39  object.Bind(target);
40  }
41 
43 
49  template <typename Object>
50  static void Bind(
51  typename Object::IndexedTarget target,
52  GLuint index,
53  const Object& object
54  )
55  {
56  object.Bind(target, index);
57  }
58 
60 
66  template <typename Object>
67  static void Bind(const Object& object)
68  {
69  object.Bind();
70  }
71 
73 
79  template <typename Object>
80  static void Use(const Object& object)
81  {
82  object.Use();
83  }
84 
85  template <typename Object>
86  static Reference<ObjectOps<
87  tag::CurrentBound,
88  typename Classify<Object>::ObjTag
89  >> Current(void)
90  {
91  typedef typename Classify<Object>::ObjTag ObjTag;
92 
94  }
95 
97  template <typename ObjectTarget>
98  static Reference<ObjectOps<
99  tag::CurrentBound,
100  typename ObjectTargetTag<ObjectTarget>::Type
101  >> Current(ObjectTarget target)
102  {
103  typedef typename ObjectTargetTag<ObjectTarget>::Type ObjTag;
104 
106  }
107 
109  template <typename Object>
110  static Reference<ObjectOps<
111  tag::CurrentBound,
112  typename ObjectTargetTag<typename Object::Target>::Type
113  >> Bound(typename Object::Target target, const Object& object)
114  {
115  object.Bind(target);
116  return Current(target);
117  }
118 };
119 
120 } // namespace context
121 } // namespace oglplus
122 
123 #endif // include guard
Wrapper for object binding operations.
Definition: object_binding.hpp:26
static void Bind(typename Object::IndexedTarget target, GLuint index, const Object &object)
Binds the specified object to the specified indexed target.
Definition: object_binding.hpp:50
Generic OpenGL object wrapper.
static void Bind(typename Object::Target target, const Object &object)
Binds the specified object to the specified target.
Definition: object_binding.hpp:37
Implements operations applicable to named (non-zero) objects.
Definition: wrap_tpl.hpp:45
static Reference< ObjectOps< tag::CurrentBound, typename ObjectTargetTag< typename Object::Target >::Type > > Bound(typename Object::Target target, const Object &object)
Binds the object to the specified target, returns a managed reference.
Definition: object_binding.hpp:113
static Reference< ObjectOps< tag::CurrentBound, typename ObjectTargetTag< ObjectTarget >::Type > > Current(ObjectTarget target)
Returns a managed reference to the object currently bound to target.
Definition: object_binding.hpp:101
static void Bind(const Object &object)
Binds the specified object to the appropriate binding point.
Definition: object_binding.hpp:67
static void Use(const Object &object)
Uses (makes current) the specified object.
Definition: object_binding.hpp:80
Allows to make managed copies of instances of Object.
Definition: fwd.hpp:172

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).