File: core_force_xyzw_only.cpp

package info (click to toggle)
glm 1.0.1%2Bds-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 8,252 kB
  • sloc: cpp: 41,050; sh: 31; makefile: 23
file content (58 lines) | stat: -rw-r--r-- 840 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#define GLM_FORCE_XYZW_ONLY

#include <glm/gtc/constants.hpp>
#include <glm/gtc/vec1.hpp>
#include <glm/ext/vector_relational.hpp>
#include <glm/vec2.hpp>
#include <glm/vec3.hpp>
#include <glm/vec4.hpp>

static int test_comp()
{
	int Error = 0;

	{
		glm::ivec1 A(1);
		Error += A.x == 1 ? 0 : 1;
	}

	{
		glm::ivec2 A(1, 2);
		Error += A.x == 1 ? 0 : 1;
		Error += A.y == 2 ? 0 : 1;
	}

	{
		glm::ivec3 A(1, 2, 3);
		Error += A.x == 1 ? 0 : 1;
		Error += A.y == 2 ? 0 : 1;
		Error += A.z == 3 ? 0 : 1;
	}

	{
		glm::ivec4 A(1, 2, 3, 4);
		Error += A.x == 1 ? 0 : 1;
		Error += A.y == 2 ? 0 : 1;
		Error += A.z == 3 ? 0 : 1;
		Error += A.w == 4 ? 0 : 1;
	}

	return Error;
}

static int test_constexpr()
{
	int Error = 0;

	return Error;
}

int main()
{
	int Error = 0;

	Error += test_comp();
	Error += test_constexpr();

	return Error;
}