OGLplus (0.52.0) a C++ wrapper for OpenGL

capability.hpp
Go to the documentation of this file.
1 
12 #pragma once
13 #ifndef OGLPLUS_CAPABILITY_1107121519_HPP
14 #define OGLPLUS_CAPABILITY_1107121519_HPP
15 
16 #include <oglplus/enumerations.hpp>
17 
18 namespace oglplus {
19 
21 
54 OGLPLUS_ENUM_CLASS_BEGIN(Capability, GLenum)
55 #include <oglplus/enums/capability.ipp>
56 OGLPLUS_ENUM_CLASS_END(Capability)
57 
58 #if !OGLPLUS_NO_ENUM_VALUE_NAMES
59 #include <oglplus/enums/capability_names.ipp>
60 #endif
61 
62 #if !OGLPLUS_ENUM_VALUE_RANGES
63 #include <oglplus/enums/capability_range.ipp>
64 #endif
65 
66 inline void operator << (Capability capability, bool enable)
67 {
68  if(enable)
69  {
70  OGLPLUS_GLFUNC(Enable)(GLenum(capability));
71  OGLPLUS_VERIFY_SIMPLE(Enable);
72  }
73  else
74  {
75  OGLPLUS_GLFUNC(Disable)(GLenum(capability));
76  OGLPLUS_VERIFY_SIMPLE(Disable);
77  }
78 }
79 
80 inline void operator + (Capability capability)
81 {
82  OGLPLUS_GLFUNC(Enable)(GLenum(capability));
83  OGLPLUS_VERIFY_SIMPLE(Enable);
84 }
85 
86 inline void operator - (Capability capability)
87 {
88  OGLPLUS_GLFUNC(Disable)(GLenum(capability));
89  OGLPLUS_VERIFY_SIMPLE(Disable);
90 }
91 
93 
132 OGLPLUS_ENUM_CLASS_BEGIN(Functionality, GLenum)
133 #include <oglplus/enums/functionality.ipp>
134 OGLPLUS_ENUM_CLASS_END(Functionality)
135 
136 #if !OGLPLUS_NO_ENUM_VALUE_NAMES
137 #include <oglplus/enums/functionality_names.ipp>
138 #endif
139 
140 #if !OGLPLUS_ENUM_VALUE_RANGES
141 #include <oglplus/enums/functionality_range.ipp>
142 #endif
143 
144 struct FunctionalityAndNumber
145 {
146  GLenum _code;
147 };
148 
149 inline FunctionalityAndNumber operator | (Functionality func, GLuint number)
150 {
151  FunctionalityAndNumber result = { GLenum(func)+number };
152  return result;
153 }
154 
155 inline void operator << (FunctionalityAndNumber func_and_num, bool enable)
156 {
157  if(enable)
158  {
159  OGLPLUS_GLFUNC(Enable)(func_and_num._code);
160  OGLPLUS_VERIFY_SIMPLE(Enable);
161  }
162  else
163  {
164  OGLPLUS_GLFUNC(Disable)(func_and_num._code);
165  OGLPLUS_VERIFY_SIMPLE(Disable);
166  }
167 }
168 
169 inline void operator + (FunctionalityAndNumber func_and_num)
170 {
171  OGLPLUS_GLFUNC(Enable)(func_and_num._code);
172  OGLPLUS_VERIFY_SIMPLE(Enable);
173 }
174 
175 inline void operator - (FunctionalityAndNumber func_and_num)
176 {
177  OGLPLUS_GLFUNC(Disable)(func_and_num._code);
178  OGLPLUS_VERIFY_SIMPLE(Disable);
179 }
180 
181 } // namespace oglplus
182 
183 #endif // include guard
Enumeration-related declarations.
Functionality
Functionality enumeration.
Definition: capability.hpp:132
Capability
Capability enumeration.
Definition: capability.hpp:54

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