Example #1
0
	void Draw(const Microsoft::WRL::ComPtr<ID3D11DeviceContext> &pDeviceContext)
	{
		// VBのセット
		ID3D11Buffer* pBufferTbl[] = { m_pVertexBuf.Get() };
		UINT SizeTbl[] = { sizeof(Vertex) };
		UINT OffsetTbl[] = { 0 };
		pDeviceContext->IASetVertexBuffers(0, 1, pBufferTbl, SizeTbl, OffsetTbl);
		// IBのセット
		pDeviceContext->IASetIndexBuffer(m_pIndexBuf.Get(), DXGI_FORMAT_R32_UINT, 0);
		// プリミティブタイプのセット
		pDeviceContext->IASetPrimitiveTopology(D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST);

		pDeviceContext->DrawIndexed(m_indices // index count
			, 0, 0);
	}
Example #2
0
void Cube::RenderBuffers(Microsoft::WRL::ComPtr<ID3D11DeviceContext1> &d3dContext)
{
    UINT stride = sizeof(VertexPositionColor);
    UINT offset = 0;
    d3dContext->IASetVertexBuffers(
        0,
        1,
		m_vertexBuffer.GetAddressOf(),
        &stride,
        &offset
        );

    d3dContext->IASetIndexBuffer(
		m_indexBuffer.Get(),
        DXGI_FORMAT_R16_UINT,
        0
        );

    d3dContext->IASetPrimitiveTopology(D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST);
}