Axiom.Graphics.VertexElement.MultiplyTypeCount C# (CSharp) Method

MultiplyTypeCount() public static method

Returns proper enum for a base type multiplied by a value. This is helpful when working with tex coords especially since you might not know the number of texture dimensions at runtime, and when creating the VertexBuffer you will have to get a VertexElementType based on that amount to creating the VertexElement.
public static MultiplyTypeCount ( VertexElementType type, int count ) : VertexElementType
type VertexElementType Data type.
count int Multiplier.
return VertexElementType
		public static VertexElementType MultiplyTypeCount( VertexElementType type, int count )
		{
			switch ( type )
			{
				case VertexElementType.Float1:
					switch ( count )
					{
						case 1:
							return VertexElementType.Float1;
						case 2:
							return VertexElementType.Float2;
						case 3:
							return VertexElementType.Float3;
						case 4:
							return VertexElementType.Float4;
					}
					break;

				case VertexElementType.Short1:
					switch ( count )
					{
						case 1:
							return VertexElementType.Short1;
						case 2:
							return VertexElementType.Short2;
						case 3:
							return VertexElementType.Short3;
						case 4:
							return VertexElementType.Short4;
					}
					break;
			}

			throw new Exception( "Cannot multiply base vertex element type: " + type.ToString() );
		}