GLSL Struct 1.4.0
glslstruct
Loading...
Searching...
No Matches
functions.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_FUNCTIONS_HPP_
12 #define _GLSL_STRUCT_FUNCTIONS_HPP_
13
14 #include <glslstruct/config.hpp>
15
17_GLSL_STRUCT_ERROR("This is only available for c++17 and greater!");
18 #else
19
20namespace glslstruct {
21 /**
22 * @brief returns value rounded up to nearest multiple of given value
23 * @ingroup glslstruct
24 */
25 [[nodiscard]] size_t ceil_to_nearest_multiple(size_t valueToRoundUp, size_t multipleValue) noexcept;
26
27 /**
28 * @brief returns array elem name
29 * @ingroup glslstruct
30 */
32
33 /**
34 * @brief returns struct elem name
35 * @ingroup glslstruct
36 */
38} // namespace glslstruct
39
40 #endif
41#endif
std::string get_array_elem_name(std::string_view arrayName, size_t elemIdx)
returns array elem name
Definition functions.cpp:26
std::string get_struct_elem_name(std::string_view structName, std::string_view elemName)
returns struct elem name
Definition functions.cpp:30
size_t ceil_to_nearest_multiple(size_t valueToRoundUp, size_t multipleValue) noexcept
returns value rounded up to nearest multiple of given value
Definition functions.cpp:21
#define _GLSL_STRUCT_HAS_CXX17
check if compiler has c++ version greater or equal to c++17
Definition config.hpp:130
Main namespace of glslstruct library.
Definition scalar_layout_traits.hpp:23