コード例 #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));
 }