Jump to content
  • Advertisement

Archived

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

Ataru

UpdateSurface

This topic is 5369 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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
Advertisement
BAH! Stupid me, just had to flip source and dst.

I still wish DirectX would provide a slightly better error lookup.

Share this post


Link to post
Share on other sites
Change to the Debug runtime in Control Panel -> DirectX. Crack up the error output all the way. Run DXSDK\bin\DXUtils\dbmon.exe. Have fun.

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

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!