• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#version 310 es
2#define X 1
3#define Y clamp
4#define Z X
5
6#define F 1, 2
7
8#define make_function \
9  float fn ( float x ) \
10  {\
11    return x + 4.0; \
12  }
13
14make_function
15
16int main() {
17  gl_Position = vec4(X);
18  gl_Position = Y(1, 2, 3);
19  gl_Position = vec4(Z);
20  gl_Position = vec4(F);
21  gl_Position = vec4(fn(3));
22  [] . ++ --
23  + - * % / - ! ~
24  << >> < > <= >=
25  == !=
26  & ^ | && ^^ || ? :
27  += -= *= /= %= <<= >>= &= |= ^=
28  1.2 2E10 5u -5lf
29}
30
31struct S {
32    int member1;
33    float member2;
34    vec4 member3;
35};
36
37#define xyz xxyz
38#define yzy() yyz
39
40#define FUN_MAC() \
41	vec3 a = vec3(0); \
42	vec3 b = a.zxyz;  \
43	vec3 b = a.xyz;   \
44	vec3 b = a.yzy();   \
45	vec3 b = a.xyz();   \
46	vec3 b = a.yzy;   \
47	vec3 b = a.z;
48
49void foo()
50{
51    S s;
52    s.member2 + s.member1;
53    s.member3.zyx;
54    s.member2.xyz;
55    s.member2.yzy();
56    s.member2.xyz();
57    s.member2.yzy;
58    FUN_MAC()
59    yzy
60
61    ();
62    yzy
63
64
65}
66