I would like to create a texture and save to the system's ram instead of the video card.
I use the following code for create a texture and save to the video card:
if (D3DXCreateTexture( d3dDevice_,width, height, 1, D3DUSAGE_DYNAMIC, D3DFMT_A8R8G8B8, D3DPOOL_DEFAULT, &text)==D3DERR_OUTOFVIDEOMEMORY )
exit(255);
i can lock it and write information to it.
with this code.
D3DLOCKED_RECT lrDst;
text->LockRect( 0, &lrDst, 0, 0 );
DWORD* pDst = (DWORD*)lrDst.pBits;
//draw 200 red pixels in to the texture
for (byte count=0, count<200, count++)
{
pDst[count] = ARGB ( 255, 255, 0, 0);
}
text->UnlockRect(0);
BUT when i use the parameter D3DPOOL_SYSTEMMEM instead of D3DPOOL_DEFAULT in D3DXCreateTexture, I cant see any drawn pixel in the screen. I only see a completly white screen.
what am i doing wrong?