Archived

This topic is now archived and is closed to further replies.

Ataru

UpdateSurface

Recommended Posts

I need help with update surface. I am getting invalid data errors, but I've followed the internal docs precisley. This is what I do:
hr = D3DXCreateTextureFromFileEx( m_pd3dDevice, "1.TGA", D3DX_DEFAULT, D3DX_DEFAULT, 0, 0,D3DFMT_UNKNOWN, D3DPOOL_DEFAULT, D3DX_DEFAULT, D3DX_DEFAULT, 0,NULL,NULL,&textures[0]);

hr = D3DXCreateTextureFromFileEx( m_pd3dDevice, "1.TGA",D3DX_DEFAULT, D3DX_DEFAULT, 0, 0, D3DFMT_UNKNOWN, D3DPOOL_SYSTEMMEM, D3DX_DEFAULT, D3DX_DEFAULT, 0,NULL,NULL, &textures[1]);

IDirect3DSurface9 *srcSurface;

IDirect3DSurface9 *dstSurface;

textures[0]->GetSurfaceLevel(0,&srcSurface);

textures[1]->GetSurfaceLevel(0,&dstSurface);

hr =  m_pd3dDevice->UpdateSurface (srcSurface,NULL,dstSurface,NULL);

if (hr != D3D_OK)
  LOG("ERROR: TEXTURE BLIT %x\n",hr);

hr always returns D3DERR_INVALIDCALL. What am I doing wrong? It's the same file (just want to get it to work at this point) so all the formats and sizes should be the same. The memory format is as DirectX expects it. What am I doing wrong? [edited by - ataru on October 7, 2003 1:32:52 PM]

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
.. or simply run your executable through VS'' debugger and watch the output window (after enabling debug output in dx control panel, of course)

Share this post


Link to post
Share on other sites