-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGLSLTrack.cs
56 lines (51 loc) · 1.15 KB
/
GLSLTrack.cs
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
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace FragmentFun
{
public enum GLSLType
{
INVALID,
SINGLE,
VEC2,
VEC3,
VEC4,
}
public struct GLSLTrack
{
public readonly List<DotRocket.Track> Tracks;
public readonly string Name;
public readonly GLSLType Type;
public GLSLTrack(string name, GLSLType type, DotRocket.Device rocket)
{
Name = name;
Type = type;
Tracks = new List<DotRocket.Track>();
switch (type)
{
case GLSLType.SINGLE:
Tracks.Add(rocket.GetTrack(Name));
break;
case GLSLType.VEC2:
Tracks.Add(rocket.GetTrack(Name + ".x"));
Tracks.Add(rocket.GetTrack(Name + ".y"));
break;
case GLSLType.VEC3:
Tracks.Add(rocket.GetTrack(Name + ".x"));
Tracks.Add(rocket.GetTrack(Name + ".y"));
Tracks.Add(rocket.GetTrack(Name + ".z"));
break;
case GLSLType.VEC4:
Tracks.Add(rocket.GetTrack(Name + ".x"));
Tracks.Add(rocket.GetTrack(Name + ".y"));
Tracks.Add(rocket.GetTrack(Name + ".z"));
Tracks.Add(rocket.GetTrack(Name + ".w"));
break;
default:
break;
}
}
}
}