Direct3D Map Pixels Black
<p>Im trying to map pixel data as a byte array to a dynamic texture using direct3d, for some reason the resulting pixel data is black and its not getting transfered.  I have converted this code directly from using updatesubresource before, but now im using map/unmap.</p>

<pre><code>ID3D11Texture2D* d3dtex = (ID3D11Texture2D*)textureHandle;
assert(d3dtex);

ID3D11DeviceContext* ctx = NULL;
m_Device-&gt;GetImmediateContext(&amp;ctx);
D3D11_MAPPED_SUBRESOURCE mappedResource;
ZeroMemory(&amp;mappedResource, sizeof(D3D11_MAPPED_SUBRESOURCE));

//    Disable GPU access to the vertex buffer data.
ctx-&gt;Map(d3dtex, 0, D3D11_MAP_WRITE, 0, &amp;mappedResource);
//    Update the vertex buffer here.
memcpy(mappedResource.pData, dataPtr, textureWidth * textureHeight * 4);
//    Reenable GPU access to the vertex buffer data.
ctx-&gt;Unmap(d3dtex, 0);
</code></pre>