parameterize number of dimensions of vector in tvec<D, T, P>
- specializes for 1, 2, 3 and 4-dimensional vector types which are then aliased as tvec1, tvec2, tvec3 and tvec4 - requires C++11 aliases; breaks compatability with C++03 - tested on: - clang-3.5.2, clang-3.8.0 - gcc 4.8.5, gcc 5.4.1, gcc 6.2.0 TODO: - still uses template template parameters - most can probably be removed - some definitions might now be de-duplicated
This commit is contained in:
@@ -528,8 +528,8 @@ int test_packUnorm()
|
||||
for(std::size_t i = 0; i < A.size(); ++i)
|
||||
{
|
||||
glm::vec2 B(A[i]);
|
||||
glm::u16vec2 C = glm::packUnorm<glm::uint16>(B);
|
||||
glm::vec2 D = glm::unpackUnorm<glm::uint16, float>(C);
|
||||
glm::u16vec2 C = glm::packUnorm<2, glm::uint16>(B);
|
||||
glm::vec2 D = glm::unpackUnorm<2, glm::uint16, float>(C);
|
||||
Error += glm::all(glm::epsilonEqual(B, D, 1.0f / 255.f)) ? 0 : 1;
|
||||
assert(!Error);
|
||||
}
|
||||
@@ -549,8 +549,8 @@ int test_packSnorm()
|
||||
for(std::size_t i = 0; i < A.size(); ++i)
|
||||
{
|
||||
glm::vec2 B(A[i]);
|
||||
glm::i16vec2 C = glm::packSnorm<glm::int16>(B);
|
||||
glm::vec2 D = glm::unpackSnorm<glm::int16, float>(C);
|
||||
glm::i16vec2 C = glm::packSnorm<2, glm::int16>(B);
|
||||
glm::vec2 D = glm::unpackSnorm<2, glm::int16, float>(C);
|
||||
Error += glm::all(glm::epsilonEqual(B, D, 1.0f / 32767.0f * 2.0f)) ? 0 : 1;
|
||||
assert(!Error);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user