OGLplus (0.52.0) a C++ wrapper for OpenGL

varpara_fns.hpp
1 
12 #pragma once
13 #ifndef OGLPLUS_PROG_VAR_VARPARA_FNS_1107121519_HPP
14 #define OGLPLUS_PROG_VAR_VARPARA_FNS_1107121519_HPP
15 
16 #include <oglplus/glfunc.hpp>
17 #include <type_traits>
18 
19 namespace oglplus {
20 
21 #define OGLPLUS_AUX_VARPARA_FNC(NAME, SUFFIX, SELECTOR, TYPE, NPARAM)\
22  static inline std::decay< \
23  decltype( :: gl ## NAME ## SUFFIX ) \
24  >::type _fns_ ## SELECTOR( \
25  std::integral_constant<std::size_t, NPARAM>, \
26  const TYPE*, ... \
27  ) \
28  { \
29  return OGLPLUS_GLFUNC(NAME ## SUFFIX); \
30  }
31 
32 #define OGLPLUS_AUX_VARPARA_FNS(NAME, SUFFIX, SELECTOR, TYPE) \
33  OGLPLUS_AUX_VARPARA_FNC(NAME ## 1, SUFFIX, SELECTOR, TYPE, 1) \
34  OGLPLUS_AUX_VARPARA_FNC(NAME ## 2, SUFFIX, SELECTOR, TYPE, 2) \
35  OGLPLUS_AUX_VARPARA_FNC(NAME ## 3, SUFFIX, SELECTOR, TYPE, 3) \
36  OGLPLUS_AUX_VARPARA_FNC(NAME ## 4, SUFFIX, SELECTOR, TYPE, 4)
37 
38 #define OGLPLUS_AUX_VARPARA_FNS_EXT(NAME, SUFFIX, EXT, SELECTOR, TYPE) \
39  OGLPLUS_AUX_VARPARA_FNS(NAME, SUFFIX##EXT, SELECTOR, TYPE)
40 
41 #define OGLPLUS_AUX_VARPARA_MAT_FNC(NAME, SUFFIX, SELECTOR, TYPE, C, R, CxR)\
42  static inline std::decay< \
43  decltype( :: gl ## NAME ## CxR ## SUFFIX ) \
44  >::type _fns_ ## SELECTOR( \
45  std::integral_constant<std::size_t, C>, \
46  std::integral_constant<std::size_t, R>, \
47  const TYPE*, ... \
48  ) \
49  { \
50  return OGLPLUS_GLFUNC(NAME ## CxR ## SUFFIX); \
51  }
52 
53 #define OGLPLUS_AUX_VARPARA_MAT_FNS(NAME, SUFFIX, SELECTOR, TYPE) \
54  OGLPLUS_AUX_VARPARA_MAT_FNC(NAME, SUFFIX, SELECTOR, TYPE, 2, 2, 2) \
55  OGLPLUS_AUX_VARPARA_MAT_FNC(NAME, SUFFIX, SELECTOR, TYPE, 2, 3, 2x3) \
56  OGLPLUS_AUX_VARPARA_MAT_FNC(NAME, SUFFIX, SELECTOR, TYPE, 2, 4, 2x4) \
57  OGLPLUS_AUX_VARPARA_MAT_FNC(NAME, SUFFIX, SELECTOR, TYPE, 3, 2, 3x2) \
58  OGLPLUS_AUX_VARPARA_MAT_FNC(NAME, SUFFIX, SELECTOR, TYPE, 3, 3, 3) \
59  OGLPLUS_AUX_VARPARA_MAT_FNC(NAME, SUFFIX, SELECTOR, TYPE, 3, 4, 3x4) \
60  OGLPLUS_AUX_VARPARA_MAT_FNC(NAME, SUFFIX, SELECTOR, TYPE, 4, 2, 4x2) \
61  OGLPLUS_AUX_VARPARA_MAT_FNC(NAME, SUFFIX, SELECTOR, TYPE, 4, 3, 4x3) \
62  OGLPLUS_AUX_VARPARA_MAT_FNC(NAME, SUFFIX, SELECTOR, TYPE, 4, 4, 4)
63 
64 #define OGLPLUS_AUX_VARPARA_MAT_FNS_EXT(NAME, SUFFIX, EXT, SELECTOR, TYPE) \
65  OGLPLUS_AUX_VARPARA_MAT_FNS(NAME, SUFFIX##EXT, SELECTOR, TYPE)
66 
67 } // namespace oglplus
68 
69 #endif // include guard
Helper macro for optional checking of availability of GL function.

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