OGLplus (0.52.0) a C++ wrapper for OpenGL

callers.hpp
1 
12 #pragma once
13 #ifndef OGLPLUS_PROG_VAR_CALLERS_1107121519_HPP
14 #define OGLPLUS_PROG_VAR_CALLERS_1107121519_HPP
15 
16 #include <oglplus/fwd.hpp>
17 #include <oglplus/glfunc.hpp>
18 #include <oglplus/error/basic.hpp>
19 #include <oglplus/prog_var/varpara_fns.hpp>
20 
21 #include <type_traits>
22 #include <cstddef>
23 
24 namespace oglplus {
25 
26 template <typename T>
27 class ProgVarCallers<tag::ImplicitSel, T>
28 {
29 protected:
30  template <typename UI>
31  static void _call_set_v(
32  GLuint /*program*/,
33  GLuint location,
34  void(GLAPIENTRY *_fn)(UI, const T*),
35  const T* v
36  )
37  {
38  _fn(location, v);
39  }
40 
41  template <typename UI, typename SI>
42  static void _call_set_v(
43  GLuint /*program*/,
44  GLuint location,
45  void(GLAPIENTRY *_fn)(UI, SI, const T*),
46  const T* v
47  )
48  {
49  _fn(location, 1, v);
50  }
51 
52  template <typename UI, typename SI>
53  static void _call_set_vn(
54  GLuint /*program*/,
55  GLuint location,
56  GLsizei n,
57  void(GLAPIENTRY *_fn)(UI, SI, const T*),
58  const T* v
59  )
60  {
61  _fn(location, n, v);
62  }
63 
64  template <typename UI, typename P>
65  static void _call_set_t(
66  GLuint /*program*/,
67  GLuint location,
68  void(GLAPIENTRY *_fn)(UI, P),
69  P v0
70  )
71  {
72  _fn(location, v0);
73  }
74 
75  template <typename UI, typename P>
76  static void _call_set_t(
77  GLuint /*program*/,
78  GLuint location,
79  void(GLAPIENTRY *_fn)(UI, P, P),
80  P v0, P v1
81  )
82  {
83  _fn(location, v0, v1);
84  }
85 
86  template <typename UI, typename P>
87  static void _call_set_t(
88  GLuint /*program*/,
89  GLuint location,
90  void(GLAPIENTRY *_fn)(UI, P, P, P),
91  P v0, P v1, P v2
92  )
93  {
94  _fn(location, v0, v1, v2);
95  }
96 
97  template <typename UI, typename P>
98  static void _call_set_t(
99  GLuint /*program*/,
100  GLuint location,
101  void(GLAPIENTRY *_fn)(UI, P, P, P, P),
102  P v0, P v1, P v2, P v3
103  )
104  {
105  _fn(location, v0, v1, v2, v3);
106  }
107 
108  template <typename ID, typename CT, typename TP>
109  static void _call_set_m(
110  GLuint /*program*/,
111  GLuint location,
112  GLsizei count,
113  GLboolean transpose,
114  void(GLAPIENTRY *_fn)(ID, CT, TP, const T*),
115  const T* v
116  )
117  {
118  _fn(location, count, transpose, v);
119  }
120 };
121 
122 template <typename T>
123 class ProgVarCallers<tag::DirectState, T>
124 {
125 protected:
126  template <typename UI>
127  static void _call_set_v(
128  GLuint program,
129  GLuint location,
130  void(GLAPIENTRY *_fn)(GLuint, UI, const T*),
131  const T* v
132  )
133  {
134  _fn(program, location, v);
135  }
136 
137  template <typename UI, typename SI>
138  static void _call_set_v(
139  GLuint program,
140  GLuint location,
141  void(GLAPIENTRY *_fn)(GLuint, UI, SI, const T*),
142  const T* v
143  )
144  {
145  _fn(program, location, 1, v);
146  }
147 
148  template <typename UI, typename SI>
149  static void _call_set_vn(
150  GLuint program,
151  GLuint location,
152  GLsizei n,
153  void(GLAPIENTRY *_fn)(GLuint, UI, SI, const T*),
154  const T* v
155  )
156  {
157  _fn(program, location, n, v);
158  }
159 
160  template <typename UI, typename P>
161  static void _call_set_t(
162  GLuint program,
163  GLuint location,
164  void(GLAPIENTRY *_fn)(GLuint, UI, P),
165  P v0
166  )
167  {
168  _fn(program, location, v0);
169  }
170 
171  template <typename UI, typename P>
172  static void _call_set_t(
173  GLuint program,
174  GLuint location,
175  void(GLAPIENTRY *_fn)(GLuint, UI, P, P),
176  P v0, P v1
177  )
178  {
179  _fn(program, location, v0, v1);
180  }
181 
182  template <typename UI, typename P>
183  static void _call_set_t(
184  GLuint program,
185  GLuint location,
186  void(GLAPIENTRY *_fn)(GLuint, UI, P, P, P),
187  P v0, P v1, P v2
188  )
189  {
190  _fn(program, location, v0, v1, v2);
191  }
192 
193  template <typename UI, typename P>
194  static void _call_set_t(
195  GLuint program,
196  GLuint location,
197  void(GLAPIENTRY *_fn)(GLuint, UI, P, P, P, P),
198  P v0, P v1, P v2, P v3
199  )
200  {
201  _fn(program, location, v0, v1, v2, v3);
202  }
203 
204  template <typename ID, typename CT, typename TP>
205  static void _call_set_m(
206  GLuint program,
207  GLuint location,
208  GLsizei count,
209  GLboolean transpose,
210  void(GLAPIENTRY *_fn)(GLuint, ID, CT, TP, const T*),
211  const T* v
212  )
213  {
214  _fn(program, location, count, transpose, v);
215  }
216 };
217 
218 } // namespace oglplus
219 
220 #endif // include guard
Forward declarations.
Helper macro for optional checking of availability of GL function.
Declaration of basic OGLplus' exceptions.

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