本文整理匯總了C#中Microsoft.Xna.Framework.Graphics.VertexElement.CopyTo方法的典型用法代碼示例。如果您正苦於以下問題:C# VertexElement.CopyTo方法的具體用法?C# VertexElement.CopyTo怎麽用?C# VertexElement.CopyTo使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Microsoft.Xna.Framework.Graphics.VertexElement
的用法示例。
在下文中一共展示了VertexElement.CopyTo方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: ExtendVertexDeclaration
/// <summary>
/// 複數の頂點要素を合成する
/// </summary>
/// <param name="graphicsDevice">頂點宣言を生成する為のGraphicsDevice</param>
/// <param name="originalElements">元の頂點要素</param>
/// <param name="extraElements">追加する頂點要素</param>
/// <returns>新要素追加後の頂點宣言</returns>
public static VertexDeclaration ExtendVertexDeclaration(
GraphicsDevice graphicsDevice,
VertexElement[] originalElements,
VertexElement[] extraElements)
{
int length = originalElements.Length + extraElements.Length;
VertexElement[] elements = new VertexElement[length];
originalElements.CopyTo( elements, 0 );
extraElements.CopyTo( elements, originalElements.Length );
return new VertexDeclaration( graphicsDevice, elements );
}
示例2: ExtendVertexDeclaration
/// <summary>
/// Modifies vertex declaration to include additional channels
/// </summary>
/// <param name="extraElements"></param>
void ExtendVertexDeclaration(VertexElement[] extraElements)
{
vertexDeclaration.Dispose();
int length = originalVertexDeclaration.Length + extraElements.Length;
VertexElement[] elements = new VertexElement[length];
originalVertexDeclaration.CopyTo(elements, 0);
extraElements.CopyTo(elements, originalVertexDeclaration.Length);
// Create
vertexDeclaration = new VertexDeclaration(device, elements);
}