GLSL Struct 1.4.0
glslstruct
Loading...
Searching...
No Matches
type_checks.hpp
1/*
2 * glslstruct - a C++ library designed to easily represent GLSL's Uniform Buffer Objects (UBOs) and Shader Storage Buffer Objects (SSBOs) in C++.
3 *
4 * Licensed under the BSD 3-Clause License with Attribution Requirement.
5 * See the LICENSE file for details: https://github.com/MAIPA01/glslstruct/blob/main/LICENSE
6 *
7 * Copyright (c) 2025, Patryk Antosik (MAIPA01)
8 */
9
10#pragma once
11#ifndef _GLSL_STRUCT_TYPE_CHECKS_HPP_
12 #define _GLSL_STRUCT_TYPE_CHECKS_HPP_
13
14 #include <glslstruct/config.hpp>
15
17_GLSL_STRUCT_ERROR(
18 "This is only available for c++17 and greater and when types are not disabled with GLSL_STRUCT_DISABLE_TYPES set to 1!"
19);
20 #else
21
22namespace glslstruct {
23 #pragma region TYPES
24 class base_type;
25 template<class Derived>
26 class type;
27 class scalar_type;
28 class vec_type;
29 class mat_type;
30 class array_type;
31 class struct_type;
32 #pragma endregion
33
34 #pragma region TYPES_HANDLES
35 /**
36 * @brief base_type container handle
37 * @ingroup glslstruct
38 */
40 /**
41 * @brief type container handle
42 * @ingroup glslstruct
43 * @tparam Derived derived type
44 */
45 template<class Derived>
47 /**
48 * @brief scalar_type container handle
49 * @ingroup glslstruct
50 */
52 /**
53 * @brief vec_type container handle
54 * @ingroup glslstruct
55 */
57 /**
58 * @brief mat_type container handle
59 * @ingroup glslstruct
60 */
62 /**
63 * @brief array_type container handle
64 * @ingroup glslstruct
65 */
67 /**
68 * @brief struct_type container handle
69 * @ingroup glslstruct
70 */
72 #pragma endregion
73
74 namespace utils {
75 /**
76 * @brief check if T is glsl type (not base_type container but derived from base_type container)
77 * @ingroup utils
78 * @tparam T type which should be a derived from base_type but not base_type
79 */
80 template<class T>
82
83 /**
84 * @brief check if T is base_type container
85 * @ingroup utils
86 * @tparam T type which should be a base_type
87 */
88 template<class T>
90
92 /**
93 * @brief check if T is glsl type (not base_type container but derived from base_type container)
94 * @ingroup utils
95 * @tparam T type which should be a derived from base_type but not base_type
96 */
97 template<class T> concept glsl_type = is_glsl_type_v<T>;
98
99 /**
100 * @brief check if T is base_type container
101 * @ingroup utils
102 * @tparam T type which should be a base_type
103 */
105 #endif
106 } // namespace utils
107} // namespace glslstruct
108
109 #endif
110#endif
#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
static _GLSL_STRUCT_CONSTEXPR17 bool is_glsl_type_v
check if T is glsl type (not base_type container but derived from base_type container)
Definition type_checks.hpp:81
static _GLSL_STRUCT_CONSTEXPR17 bool is_glsl_base_type_v
check if T is base_type container
Definition type_checks.hpp:89
#define _GLSL_STRUCT_HAS_TYPES
check if user not disabled type containers using GLSL_STRUCT_DISABLE_TYPES
Definition config.hpp:162
#define _GLSL_STRUCT_CONSTEXPR17
constexpr for c++17 and higher
Definition config.hpp:196
Definition writer.hpp:25
Main namespace of glslstruct library.
Definition scalar_layout_traits.hpp:23