2
3
4
5
6
7
8
11#ifndef _GLSL_STRUCT_VARIABLE_HPP_
12 #define _GLSL_STRUCT_VARIABLE_HPP_
14 #include <glslstruct/config.hpp>
17_GLSL_STRUCT_ERROR(
"This is only available for c++17 and greater!");
20 #include <glslstruct/types.hpp>
25
26
27
28 struct standard_variable {};
31
32
33
34
35 template<
class Layout>
36 struct layout_variable {
41 explicit layout_variable(
const Layout& layout) : layout(layout) {}
46
47
48
49
50
52 template<utils::glsl_simple_or_layout T, size_t Num>
54 template<
class T, size_t Num, std::enable_if_t<utils::is_glsl_simple_or_layout_v<T>,
bool> >
57 :
public std::conditional_t<utils::is_glsl_layout_v<T>, utils::layout_variable<T>, utils::standard_variable> {
68 #pragma region VARIABLES
70 const std::string varName;
73 #pragma region NORMAL_CONSTRUCTOR
76 template<
class Type = var_type,
77 std::enable_if_t<utils::is_glsl_simple_v<Type> && std::is_same_v<Type, var_type>,
bool> =
true>
80 const std::string_view name
87 #pragma region LAYOUT_CONSTRUCTOR
90 template<
class Type = var_type,
91 std::enable_if_t<utils::is_glsl_layout_v<Type> && std::is_same_v<Type, var_type>,
bool> =
true>
95 : utils::layout_variable<T>(layout), varName(name) {
#define _GLSL_STRUCT_CONSTEXPR20
constexpr keyword for c++20 and higher
Definition config.hpp:213
#define _GLSL_STRUCT_HAS_CXX20
check if compiler has c++ version greater or equal to c++20 and if user enabled c++20 features using ...
Definition config.hpp:142
#define _GLSL_STRUCT_HAS_CXX17
check if compiler has c++ version greater or equal to c++17
Definition config.hpp:130
#define _GLSL_STRUCT_REQUIRES(condition)
requires keyword for c++20 and higher
Definition config.hpp:214
#define _GLSL_STRUCT_CONSTEXPR17
constexpr for c++17 and higher
Definition config.hpp:196