您的位置:首页 > 其它

[Slimdx]顶点和索引缓冲,绘制了2个分离的三角形

2015-04-07 18:27 309 查看
定义网格顶点和索引缓冲,绘制了2个分离的三角形。

public static IndexBuffer CreateIndexBuffer(Device device, short[] indicesData)
{
IndexBuffer indexBuffer = new IndexBuffer(device, 16 * indicesData.Length, Usage.WriteOnly, Pool.Default, true);
DataStream ds = indexBuffer.Lock(0, 16 * indicesData.Length, LockFlags.None);
ds.WriteRange(indicesData);
indexBuffer.Unlock();
ds.Dispose();
return indexBuffer;
}


CreateIndexBuffer
效果图:

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐