Antkeeper  0.0.1
shader-variable.cpp
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2023 Christopher J. Howard
3  *
4  * This file is part of Antkeeper source code.
5  *
6  * Antkeeper source code is free software: you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation, either version 3 of the License, or
9  * (at your option) any later version.
10  *
11  * Antkeeper source code is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with Antkeeper source code. If not, see <http://www.gnu.org/licenses/>.
18  */
19 
21 #include <stdexcept>
22 
23 namespace gl {
24 
25 static const char* type_mismatch_error = "Shader variable type mismatch";
26 
27 shader_variable::shader_variable(std::size_t size) noexcept:
28  m_size{size}
29 {}
30 
31 void shader_variable::update(bool value) const
32 {
33  throw std::invalid_argument(type_mismatch_error);
34 }
35 
36 void shader_variable::update(const math::bvec2& value) const
37 {
38  throw std::invalid_argument(type_mismatch_error);
39 }
40 
41 void shader_variable::update(const math::bvec3& value) const
42 {
43  throw std::invalid_argument(type_mismatch_error);
44 }
45 
46 void shader_variable::update(const math::bvec4& value) const
47 {
48  throw std::invalid_argument(type_mismatch_error);
49 }
50 
51 void shader_variable::update(int value) const
52 {
53  throw std::invalid_argument(type_mismatch_error);
54 }
55 
56 void shader_variable::update(const math::ivec2& value) const
57 {
58  throw std::invalid_argument(type_mismatch_error);
59 }
60 
61 void shader_variable::update(const math::ivec3& value) const
62 {
63  throw std::invalid_argument(type_mismatch_error);
64 }
65 
66 void shader_variable::update(const math::ivec4& value) const
67 {
68  throw std::invalid_argument(type_mismatch_error);
69 }
70 
71 void shader_variable::update(unsigned int value) const
72 {
73  throw std::invalid_argument(type_mismatch_error);
74 }
75 
76 void shader_variable::update(const math::uvec2& value) const
77 {
78  throw std::invalid_argument(type_mismatch_error);
79 }
80 
81 void shader_variable::update(const math::uvec3& value) const
82 {
83  throw std::invalid_argument(type_mismatch_error);
84 }
85 
86 void shader_variable::update(const math::uvec4& value) const
87 {
88  throw std::invalid_argument(type_mismatch_error);
89 }
90 
91 void shader_variable::update(float value) const
92 {
93  throw std::invalid_argument(type_mismatch_error);
94 }
95 
96 void shader_variable::update(const math::fvec2& value) const
97 {
98  throw std::invalid_argument(type_mismatch_error);
99 }
100 
101 void shader_variable::update(const math::fvec3& value) const
102 {
103  throw std::invalid_argument(type_mismatch_error);
104 }
105 
106 void shader_variable::update(const math::fvec4& value) const
107 {
108  throw std::invalid_argument(type_mismatch_error);
109 }
110 
111 void shader_variable::update(const math::fmat2& value) const
112 {
113  throw std::invalid_argument(type_mismatch_error);
114 }
115 
116 void shader_variable::update(const math::fmat3& value) const
117 {
118  throw std::invalid_argument(type_mismatch_error);
119 }
120 
121 void shader_variable::update(const math::fmat4& value) const
122 {
123  throw std::invalid_argument(type_mismatch_error);
124 }
125 
126 void shader_variable::update(const texture_1d& value) const
127 {
128  throw std::invalid_argument(type_mismatch_error);
129 }
130 
131 void shader_variable::update(const texture_2d& value) const
132 {
133  throw std::invalid_argument(type_mismatch_error);
134 }
135 
136 void shader_variable::update(const texture_3d& value) const
137 {
138  throw std::invalid_argument(type_mismatch_error);
139 }
140 
141 void shader_variable::update(const texture_cube& value) const
142 {
143  throw std::invalid_argument(type_mismatch_error);
144 }
145 
146 void shader_variable::update(bool value, std::size_t index) const
147 {
148  throw std::invalid_argument(type_mismatch_error);
149 }
150 
151 void shader_variable::update(const math::bvec2& value, std::size_t index) const
152 {
153  throw std::invalid_argument(type_mismatch_error);
154 }
155 
156 void shader_variable::update(const math::bvec3& value, std::size_t index) const
157 {
158  throw std::invalid_argument(type_mismatch_error);
159 }
160 
161 void shader_variable::update(const math::bvec4& value, std::size_t index) const
162 {
163  throw std::invalid_argument(type_mismatch_error);
164 }
165 
166 void shader_variable::update(int value, std::size_t index) const
167 {
168  throw std::invalid_argument(type_mismatch_error);
169 }
170 
171 void shader_variable::update(const math::ivec2& value, std::size_t index) const
172 {
173  throw std::invalid_argument(type_mismatch_error);
174 }
175 
176 void shader_variable::update(const math::ivec3& value, std::size_t index) const
177 {
178  throw std::invalid_argument(type_mismatch_error);
179 }
180 
181 void shader_variable::update(const math::ivec4& value, std::size_t index) const
182 {
183  throw std::invalid_argument(type_mismatch_error);
184 }
185 
186 void shader_variable::update(unsigned int value, std::size_t index) const
187 {
188  throw std::invalid_argument(type_mismatch_error);
189 }
190 
191 void shader_variable::update(const math::uvec2& value, std::size_t index) const
192 {
193  throw std::invalid_argument(type_mismatch_error);
194 }
195 
196 void shader_variable::update(const math::uvec3& value, std::size_t index) const
197 {
198  throw std::invalid_argument(type_mismatch_error);
199 }
200 
201 void shader_variable::update(const math::uvec4& value, std::size_t index) const
202 {
203  throw std::invalid_argument(type_mismatch_error);
204 }
205 
206 void shader_variable::update(float value, std::size_t index) const
207 {
208  throw std::invalid_argument(type_mismatch_error);
209 }
210 
211 void shader_variable::update(const math::fvec2& value, std::size_t index) const
212 {
213  throw std::invalid_argument(type_mismatch_error);
214 }
215 
216 void shader_variable::update(const math::fvec3& value, std::size_t index) const
217 {
218  throw std::invalid_argument(type_mismatch_error);
219 }
220 
221 void shader_variable::update(const math::fvec4& value, std::size_t index) const
222 {
223  throw std::invalid_argument(type_mismatch_error);
224 }
225 
226 void shader_variable::update(const math::fmat2& value, std::size_t index) const
227 {
228  throw std::invalid_argument(type_mismatch_error);
229 }
230 
231 void shader_variable::update(const math::fmat3& value, std::size_t index) const
232 {
233  throw std::invalid_argument(type_mismatch_error);
234 }
235 
236 void shader_variable::update(const math::fmat4& value, std::size_t index) const
237 {
238  throw std::invalid_argument(type_mismatch_error);
239 }
240 
241 void shader_variable::update(const texture_1d& value, std::size_t index) const
242 {
243  throw std::invalid_argument(type_mismatch_error);
244 }
245 
246 void shader_variable::update(const texture_2d& value, std::size_t index) const
247 {
248  throw std::invalid_argument(type_mismatch_error);
249 }
250 
251 void shader_variable::update(const texture_3d& value, std::size_t index) const
252 {
253  throw std::invalid_argument(type_mismatch_error);
254 }
255 
256 void shader_variable::update(const texture_cube& value, std::size_t index) const
257 {
258  throw std::invalid_argument(type_mismatch_error);
259 }
260 
261 void shader_variable::update(std::span<const bool> values, std::size_t index) const
262 {
263  throw std::invalid_argument(type_mismatch_error);
264 }
265 
266 void shader_variable::update(std::span<const math::bvec2> values, std::size_t index) const
267 {
268  throw std::invalid_argument(type_mismatch_error);
269 }
270 
271 void shader_variable::update(std::span<const math::bvec3> values, std::size_t index) const
272 {
273  throw std::invalid_argument(type_mismatch_error);
274 }
275 
276 void shader_variable::update(std::span<const math::bvec4> values, std::size_t index) const
277 {
278  throw std::invalid_argument(type_mismatch_error);
279 }
280 
281 void shader_variable::update(std::span<const int> values, std::size_t index) const
282 {
283  throw std::invalid_argument(type_mismatch_error);
284 }
285 
286 void shader_variable::update(std::span<const math::ivec2> values, std::size_t index) const
287 {
288  throw std::invalid_argument(type_mismatch_error);
289 }
290 
291 void shader_variable::update(std::span<const math::ivec3> values, std::size_t index) const
292 {
293  throw std::invalid_argument(type_mismatch_error);
294 }
295 
296 void shader_variable::update(std::span<const math::ivec4> values, std::size_t index) const
297 {
298  throw std::invalid_argument(type_mismatch_error);
299 }
300 
301 void shader_variable::update(std::span<const unsigned int> values, std::size_t index) const
302 {
303  throw std::invalid_argument(type_mismatch_error);
304 }
305 
306 void shader_variable::update(std::span<const math::uvec2> values, std::size_t index) const
307 {
308  throw std::invalid_argument(type_mismatch_error);
309 }
310 
311 void shader_variable::update(std::span<const math::uvec3> values, std::size_t index) const
312 {
313  throw std::invalid_argument(type_mismatch_error);
314 }
315 
316 void shader_variable::update(std::span<const math::uvec4> values, std::size_t index) const
317 {
318  throw std::invalid_argument(type_mismatch_error);
319 }
320 
321 void shader_variable::update(std::span<const float> values, std::size_t index) const
322 {
323  throw std::invalid_argument(type_mismatch_error);
324 }
325 
326 void shader_variable::update(std::span<const math::fvec2> values, std::size_t index) const
327 {
328  throw std::invalid_argument(type_mismatch_error);
329 }
330 
331 void shader_variable::update(std::span<const math::fvec3> values, std::size_t index) const
332 {
333  throw std::invalid_argument(type_mismatch_error);
334 }
335 
336 void shader_variable::update(std::span<const math::fvec4> values, std::size_t index) const
337 {
338  throw std::invalid_argument(type_mismatch_error);
339 }
340 
341 void shader_variable::update(std::span<const math::fmat2> values, std::size_t index) const
342 {
343  throw std::invalid_argument(type_mismatch_error);
344 }
345 
346 void shader_variable::update(std::span<const math::fmat3> values, std::size_t index) const
347 {
348  throw std::invalid_argument(type_mismatch_error);
349 }
350 
351 void shader_variable::update(std::span<const math::fmat4> values, std::size_t index) const
352 {
353  throw std::invalid_argument(type_mismatch_error);
354 }
355 
356 void shader_variable::update(std::span<const texture_1d* const> values, std::size_t index) const
357 {
358  throw std::invalid_argument(type_mismatch_error);
359 }
360 
361 void shader_variable::update(std::span<const texture_2d* const> values, std::size_t index) const
362 {
363  throw std::invalid_argument(type_mismatch_error);
364 }
365 
366 void shader_variable::update(std::span<const texture_3d* const> values, std::size_t index) const
367 {
368  throw std::invalid_argument(type_mismatch_error);
369 }
370 
371 void shader_variable::update(std::span<const texture_cube* const> values, std::size_t index) const
372 {
373  throw std::invalid_argument(type_mismatch_error);
374 }
375 
376 void shader_variable::update(std::span<const std::shared_ptr<texture_1d>> values, std::size_t index) const
377 {
378  throw std::invalid_argument(type_mismatch_error);
379 }
380 
381 void shader_variable::update(std::span<const std::shared_ptr<texture_2d>> values, std::size_t index) const
382 {
383  throw std::invalid_argument(type_mismatch_error);
384 }
385 
386 void shader_variable::update(std::span<const std::shared_ptr<texture_3d>> values, std::size_t index) const
387 {
388  throw std::invalid_argument(type_mismatch_error);
389 }
390 
391 void shader_variable::update(std::span<const std::shared_ptr<texture_cube>> values, std::size_t index) const
392 {
393  throw std::invalid_argument(type_mismatch_error);
394 }
395 
396 } // namespace gl
virtual void update(bool value) const
Updates the value of the variable.
shader_variable(std::size_t size) noexcept
Constructs a shader variable.
1D texture.
Definition: texture.hpp:73
2D texture.
Definition: texture.hpp:141
3D texture.
Definition: texture.hpp:209
Cube texture.
Definition: texture.hpp:243
Graphics library interface.
Definition: window.hpp:28
n by m column-major matrix.
Definition: math/matrix.hpp:44
n-dimensional vector.
Definition: vector.hpp:44