Esempio n. 1
0
 public void EnsureType(ShaderElementType expect)
 {
     if (Type != expect)
     {
         throw new TypeMismatchException(expect, Type);
     }
 }
Esempio n. 2
0
 internal ShaderAttribute(string name, ShaderElementType type, int loc)
 {
     if (string.IsNullOrWhiteSpace(name))
     {
         throw new ArgumentNullException(nameof(name));
     }
     Name      = name;
     Type      = type ?? throw new ArgumentNullException(nameof(type));
     _location = loc;
 }
Esempio n. 3
0
 internal Uniform(string nm, ShaderElementType t, int loc)
 {
     if (string.IsNullOrWhiteSpace(nm))
     {
         throw new ArgumentNullException(nameof(nm));
     }
     Name      = nm;
     _location = loc;
     Type      = t ?? throw new ArgumentNullException(nameof(t));
 }
Esempio n. 4
0
 public TypeMismatchException(ShaderElementType e, ShaderElementType g) : base($"Expected type '{e}', got '{g}'!")
 {
     ExpectedType = e ?? throw new ArgumentNullException(nameof(e));
     GivenType    = g ?? throw new ArgumentNullException(nameof(g));
 }