IDirectDrawSurface9 to Texture
Hi guys,
I've got an IDirect3DSurface9 which contains a copy of back buffer (copied using IDirect3DDevice9::StretchRect(...) ), and I now want to draw this back to the screen as a texture. I have been unable to locate a way of converting the surface to a texture in order to draw it. Does anyone know a way of doing this?
Thanks in advance.
- James
Well did you make a texture and a surface?
get yer back buffer...
m_pd3dDevice->GetBackBuffer(...);
then create the texture...
CreateTexture(...);
then tie it together...
GetSurfaceLevel(...);
check msdn.microsoft.com for info about each... If ya need specifics u cant find just say
ALSO: if u want to make sure its saving correctly, do a:
D3DXSaveTextureToFile(...);
get yer back buffer...
m_pd3dDevice->GetBackBuffer(...);
then create the texture...
CreateTexture(...);
then tie it together...
GetSurfaceLevel(...);
check msdn.microsoft.com for info about each... If ya need specifics u cant find just say
ALSO: if u want to make sure its saving correctly, do a:
D3DXSaveTextureToFile(...);
The way that I was doing it:
I'm not sure if that is the exact code, since I'm on a different computer, but I believe that is the gist of what I was doing.
IDirect3DTexture9* m_pBackBuffer = 0;m_pDevice->CreateTexture(800, 600, 1, 0, D3DFMT_A8R8G8B8, D3DPOOL_MANAGED, 0);IDirect3DSurface9* pSurface = 0;m_pBackBuffer->GetSurfaceLevel(0, &pSurface);m_pDevice->GetBackBuffer(0, 0, D3DBACKBUFFER_TYPE_MONO, &pSurface);pSurface->Release();
I'm not sure if that is the exact code, since I'm on a different computer, but I believe that is the gist of what I was doing.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement