Skip to content

Instantly share code, notes, and snippets.

@baobao
Last active December 7, 2018 02:39
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/b51843f871b522529c1c07d27ae19162 to your computer and use it in GitHub Desktop.
Save baobao/b51843f871b522529c1c07d27ae19162 to your computer and use it in GitHub Desktop.
三角形描画部分コード
// InputLaoutをセット
device.ImmediateContext.InputAssembler.InputLayout = vertexLayout;
// 頂点バッファをセット
device.ImmediateContext.InputAssembler.SetVertexBuffers(
0, new VertexBufferBinding(
// セットするバッファ
vertexBuffer,
// 1頂点あたりのバイト数(この場合24バイト)
sizeof(float) * 3,
// オフセット値(基本0)
0)
);
// 三角形の描画方法をセット
device.ImmediateContext.InputAssembler.PrimitiveTopology
= PrimitiveTopology.TriangleList;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment