示例#1
0
 public void EnsureType(ShaderElementType expect)
 {
     if (Type != expect)
     {
         throw new TypeMismatchException(expect, Type);
     }
 }
示例#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;
 }
示例#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));
 }
示例#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));
 }