From bd5ff725072f4c12e15dd30f0fa920e0af0930ce Mon Sep 17 00:00:00 2001 From: Sam Hocevar Date: Sun, 20 May 2012 12:30:52 +0000 Subject: [PATCH] math: declare some HLSL-compliant types. --- src/lol/math/vector.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/lol/math/vector.h b/src/lol/math/vector.h index 55658e90..617480ea 100644 --- a/src/lol/math/vector.h +++ b/src/lol/math/vector.h @@ -63,6 +63,24 @@ DECLARE_VECTOR_TYPEDEFS(Mat2, mat2) DECLARE_VECTOR_TYPEDEFS(Mat3, mat3) DECLARE_VECTOR_TYPEDEFS(Mat4, mat4) +/* + * HLSL/Cg-compliant type names. + */ + +typedef vec2 float2; +typedef vec3 float3; +typedef vec4 float4; +typedef mat2 float2x2; +typedef mat3 float3x3; +typedef mat4 float4x4; + +typedef ivec2 int2; +typedef ivec3 int3; +typedef ivec4 int4; +typedef imat2 int2x2; +typedef imat3 int3x3; +typedef imat4 int4x4; + /* * Magic vector swizzling (part 1/2) * These vectors are empty, but thanks to static_cast we can take their