In Direct3D 9, you can upload pixels to a dynamic texture via the following:
-
Create the Texture: In D3D9 you can create the texture using the
CreateTexture
method. Make sure to specify theD3DUSAGE_DYNAMIC
flag in theUsage
parameter.IDirect3DTexture9* pDynamicTexture = NULL; HRESULT hr = pDevice->CreateTexture(width, height, 1, D3DUSAGE_DYNAMIC, D3DFMT_A8R8G8B8, D3DPOOL_DEFAULT, &pDynamicTexture, NULL);