Skip to content

Instantly share code, notes, and snippets.

@baobao
Created November 14, 2018 03:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save baobao/e84dbb32190aca0c17b13569595135f8 to your computer and use it in GitHub Desktop.
Save baobao/e84dbb32190aca0c17b13569595135f8 to your computer and use it in GitHub Desktop.
頂点バッファ生成部分コード
Buffer CreateVertexBuffer(Device device, System.Array vertices)
{
using (DataStream vertexStream
= new DataStream(vertices, true, true))
{
return new Buffer(
device,
vertexStream,
new BufferDescription()
{
// バッファのサイズ
SizeInBytes = (int)vertexStream.Length,
// バッファの種類
BindFlags = BindFlags.VertexBuffer
});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment