GLSL Struct 1.4.0
glslstruct
Loading...
Searching...
No Matches
glslstruct::glsl_variable< T, Num > Struct Template Reference

container for variables for easier initialization of layouts More...

#include <glsl_variable.hpp>

Inheritance diagram for glslstruct::glsl_variable< T, Num >:
[legend]
Collaboration diagram for glslstruct::glsl_variable< T, Num >:
[legend]

Public Types

using var_type = T
 var type

Public Member Functions

_GLSL_STRUCT_CONSTEXPR20 glsl_variable (const std::string_view name) noexcept _GLSL_STRUCT_REQUIRES(utils
 standard constructor with variable name
_GLSL_STRUCT_CONSTEXPR20 glsl_variable (const std::string_view name, const T &layout) noexcept _GLSL_STRUCT_REQUIRES(utils
 standard constructor with variable name and layout

Public Attributes

const std::string varName
 variable name

Static Public Attributes

static _GLSL_STRUCT_CONSTEXPR17 size_t array_size = Num
 size of array
static _GLSL_STRUCT_CONSTEXPR17 bool is_array = array_size > 0
 value indicating if it is array or not
static _GLSL_STRUCT_CONSTEXPR17 bool is_layout = utils::is_glsl_layout_v<T>
 value indicating if it is layout variable or not

Detailed Description

template<utils::glsl_simple_or_layout T, size_t Num>
struct glslstruct::glsl_variable< T, Num >

container for variables for easier initialization of layouts

Template Parameters
Tvariable type
numnumber of elements in array (default is 0. if it is 0 then it is not array but a single value)

Member Typedef Documentation

◆ var_type

template<utils::glsl_simple_or_layout T, size_t Num>
using glslstruct::glsl_variable< T, Num >::var_type = T

var type

Constructor & Destructor Documentation

◆ glsl_variable() [1/2]

template<utils::glsl_simple_or_layout T, size_t Num>
_GLSL_STRUCT_CONSTEXPR20 glslstruct::glsl_variable< T, Num >::glsl_variable ( const std::string_view name)
inlineexplicitnoexcept

standard constructor with variable name

◆ glsl_variable() [2/2]

template<utils::glsl_simple_or_layout T, size_t Num>
_GLSL_STRUCT_CONSTEXPR20 glslstruct::glsl_variable< T, Num >::glsl_variable ( const std::string_view name,
const T & layout )
inlinenoexcept

standard constructor with variable name and layout

Member Data Documentation

◆ array_size

template<utils::glsl_simple_or_layout T, size_t Num>
_GLSL_STRUCT_CONSTEXPR17 size_t glslstruct::glsl_variable< T, Num >::array_size = Num
static

size of array

◆ is_array

template<utils::glsl_simple_or_layout T, size_t Num>
_GLSL_STRUCT_CONSTEXPR17 bool glslstruct::glsl_variable< T, Num >::is_array = array_size > 0
static

value indicating if it is array or not

◆ is_layout

template<utils::glsl_simple_or_layout T, size_t Num>
_GLSL_STRUCT_CONSTEXPR17 bool glslstruct::glsl_variable< T, Num >::is_layout = utils::is_glsl_layout_v<T>
static

value indicating if it is layout variable or not

◆ varName

template<utils::glsl_simple_or_layout T, size_t Num>
const std::string glslstruct::glsl_variable< T, Num >::varName

variable name