public override void setData <T>(T[] bufferInSystemMemory, int destinationOffsetInBytes, int lengthInBytes) { if (typeof(T) == typeof(byte)) { myDataType = IndexBufferDatatype.UnsignedByte; count = lengthInBytes / 1; } else if (typeof(T) == typeof(ushort)) { myDataType = IndexBufferDatatype.UnsignedShort; count = lengthInBytes / 2; } else if (typeof(T) == typeof(uint)) { myDataType = IndexBufferDatatype.UnsignedInt; count = lengthInBytes / 4; } else { throw new ArgumentException("bufferInSystemMemory must be an array of byte, ushort or uint.", "bufferInSystemMemory"); } base.setData(bufferInSystemMemory, destinationOffsetInBytes, lengthInBytes); }
public static int SizeOf(IndexBufferDatatype type) { switch (type) { case IndexBufferDatatype.UnsignedShort: return sizeof(ushort); case IndexBufferDatatype.UnsignedInt: return sizeof(uint); } throw new ArgumentException("type"); }
public static int SizeOf(IndexBufferDatatype type) { switch (type) { case IndexBufferDatatype.UnsignedShort: return(sizeof(ushort)); case IndexBufferDatatype.UnsignedInt: return(sizeof(uint)); } throw new ArgumentException("type"); }
public static DrawElementsType To(IndexBufferDatatype type) { switch (type) { case IndexBufferDatatype.UnsignedShort: return(DrawElementsType.UnsignedShort); case IndexBufferDatatype.UnsignedInt: return(DrawElementsType.UnsignedInt); } throw new ArgumentException("type"); }
public static DrawElementsType To(IndexBufferDatatype type) { switch (type) { case IndexBufferDatatype.UnsignedShort: return DrawElementsType.UnsignedShort; case IndexBufferDatatype.UnsignedInt: return DrawElementsType.UnsignedInt; } throw new ArgumentException("type"); }