3 #if SILICONSTUDIO_PARADOX_GRAPHICS_API_OPENGL
5 #if SILICONSTUDIO_PARADOX_GRAPHICS_API_OPENGLES
6 using OpenTK.Graphics.ES30;
8 using OpenTK.Graphics.OpenGL;
11 namespace SiliconStudio.
Paradox.Graphics
13 internal struct VertexAttrib : IEquatable<VertexAttrib>
15 public int VertexBufferId;
18 public bool IsInteger;
19 public VertexAttribPointerType
Type;
20 public bool Normalized;
23 public string AttributeName;
25 public bool Equals(VertexAttrib other)
27 return VertexBufferId == other.VertexBufferId && Index == other.Index && Size == other.Size && IsInteger.Equals(other.IsInteger) && Type == other.Type && Normalized.Equals(other.Normalized) && Stride == other.Stride && Offset.Equals(other.Offset) &&
string.Equals(AttributeName, other.AttributeName);
30 public override bool Equals(
object obj)
32 if (ReferenceEquals(null, obj))
return false;
33 return obj is VertexAttrib && Equals((VertexAttrib) obj);
36 public override int GetHashCode()
40 int hashCode = VertexBufferId;
41 hashCode = (hashCode*397) ^ Index;
42 hashCode = (hashCode*397) ^ Size;
43 hashCode = (hashCode*397) ^ IsInteger.GetHashCode();
44 hashCode = (hashCode*397) ^ (
int)
Type;
45 hashCode = (hashCode*397) ^ Normalized.GetHashCode();
46 hashCode = (hashCode*397) ^ Stride;
47 hashCode = (hashCode*397) ^ Offset.GetHashCode();
48 hashCode = (hashCode*397) ^ AttributeName.GetHashCode();
53 public static bool operator ==(VertexAttrib left, VertexAttrib right)
55 return left.Equals(right);
58 public static bool operator !=(VertexAttrib left, VertexAttrib right)
60 return !left.Equals(right);
The type of the serialized type will be passed as a generic arguments of the serializer. Example: serializer of A becomes instantiated as Serializer{A}.