StapleGL
Header-only C++20 OpenGL wrapper
|
Enumerations | |
enum class | shader_array_type : std::uint8_t { float32_arr , vec2_arr , vec3_arr , vec4_arr , mat3_arr , mat4_arr } |
Enumerator that represents an array of a given data type. More... | |
enum class | u_type : std::uint8_t { float32 , vec2 , vec3 , vec4 , mat3 , mat4 } |
Enumerator that represents a data type. More... | |
Functions | |
static constexpr auto | size (u_type type) -> std::size_t |
Get the size of the shader data type. | |
static constexpr auto | to_opengl_type (u_type type) -> std::uint32_t |
Convert the shader data type to an OpenGL type. | |
static constexpr auto | to_opengl_underlying_type (u_type type) -> std::uint32_t |
Obtains the OpenGL type of the underlying type of the shader data type. | |
static constexpr auto | component_count (u_type type) -> std::uint16_t |
Get the number of components in the shader data type, useful for vector types. | |
|
strong |
Enumerator that represents an array of a given data type.
Enumerator that represents an array of a given data type. This is used to define the type of the data that is passed as uniform to the shader, as well as a runtime type to feed as a parameter to other functions.
Enumerator | |
---|---|
float32_arr | |
vec2_arr | |
vec3_arr | |
vec4_arr | |
mat3_arr | |
mat4_arr |
Definition at line 38 of file shader_data_type.hpp.
|
strong |
Enumerator that represents a data type.
Enumerator that represents a data type. This is used to define the type of the data that is passed as a uniform to the shader, as well as a runtime type to feed as a parameter to other functions in this module.
Enumerator | |
---|---|
float32 | |
vec2 | |
vec3 | |
vec4 | |
mat3 | |
mat4 |
Definition at line 59 of file shader_data_type.hpp.
|
staticconstexpr |
Get the number of components in the shader data type, useful for vector types.
type | the type of the shader data. |
Definition at line 169 of file shader_data_type.hpp.
|
staticconstexpr |
Get the size of the shader data type.
type | the type of the shader data. |
Definition at line 76 of file shader_data_type.hpp.
|
staticconstexpr |
Convert the shader data type to an OpenGL type.
type | the type of the shader data. |
Definition at line 107 of file shader_data_type.hpp.
|
staticconstexpr |
Obtains the OpenGL type of the underlying type of the shader data type.
This function retrieves the OpenGL type of the underlying type of the shader data type. For scalar types, this is the same as to_opengl_type, but for vector types, this is the type of the vector's components.
type |
Definition at line 142 of file shader_data_type.hpp.