Hey I got one question, about c++ Directx 3d 11 buffers. Is it possible to change created buffer ByteWidth value? I only found a way how to change pSysMem (as I understand its a info that buffer holding) with memcpy, but its no use without changing ByteWidth.
Code:
D3D11_BUFFER_DESC m_vertexBufferDesc;
ID3D11Buffer *m_vertexBuffer;
D3D11_SUBRESOURCE_DATA vertexData;
//Create vertex buffer
m_vertexBufferDesc.Usage = D3D11_USAGE_DYNAMIC;
m_vertexBufferDesc.[COLOR="Red"]ByteWidth[/COLOR] = sizeof(VertexType) * m_vertexCount;
m_vertexBufferDesc.BindFlags = D3D11_BIND_VERTEX_BUFFER;
m_vertexBufferDesc.CPUAccessFlags = D3D11_CPU_ACCESS_WRITE;
m_vertexBufferDesc.MiscFlags = 0;
m_vertexBufferDesc.StructureByteStride = 0;
//Creates a pointer to vertex array
vertexData.pSysMem = m_vertices;
vertexData.SysMemPitch = 0;
vertexData.SysMemSlicePitch = 0;
device->CreateBuffer(&m_vertexBufferDesc, &vertexData, &m_vertexBuffer);