本文整理汇总了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);
}