82 return sizeof(float) * 2;
84 return sizeof(float) * 3;
86 return sizeof(float) * 4;
93 std::fprintf(stderr, STAPLEGL_LINEINFO
", invalid shader enum %d\n",
94 static_cast<int>(type));
111 return GL_FLOAT_VEC2;
113 return GL_FLOAT_VEC3;
115 return GL_FLOAT_VEC4;
117 return GL_FLOAT_MAT3;
119 return GL_FLOAT_MAT4;
125 std::fprintf(stderr, STAPLEGL_LINEINFO
", invalid shader enum %d\n",
126 static_cast<int>(type));
154 std::fprintf(stderr, STAPLEGL_LINEINFO
", invalid shader enum %d\n",
155 static_cast<int>(type));
186 std::fprintf(stderr, STAPLEGL_LINEINFO
", invalid shader enum %d\n",
187 static_cast<int>(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.
static constexpr auto to_opengl_type(u_type type) -> std::uint32_t
Convert the shader data type to an OpenGL type.
u_type
Enumerator that represents a data type.
static constexpr auto size(u_type type) -> std::size_t
Get the size of the shader data 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.
shader_array_type
Enumerator that represents an array of a given data type.