无法创建顶点缓冲区

时间:2016-07-06 07:21:46

标签: c++ directx vertex-buffer

当我尝试创建顶点缓冲区时,它失败并且HRESULT值为INVALID_ARGUMENT。源代码如下:

D3D11_BUFFER_DESC bufferDesc;
D3D11_SUBRESOURCE_DATA bufferData;

bufferData.pSysMem = NULL;
bufferData.SysMemPitch = NULL;
bufferData.SysMemSlicePitch = NULL;

bufferDesc.ByteWidth = 1024 * sizeof(SpriteVertex);
bufferDesc.Usage = D3D11_USAGE_DEFAULT;
bufferDesc.BindFlags = D3D11_BIND_VERTEX_BUFFER;
bufferDesc.CPUAccessFlags = NULL;
bufferDesc.MiscFlags = NULL;
bufferDesc.StructureByteStride = sizeof(SpriteVertex);

pDevice->CreateBuffer(&bufferDesc, &bufferData, &m_pVertexBuffer);

有人知道为什么会出现此错误吗?

0 个答案:

没有答案