GetRenderTargetData, UpdateSurface, StretchRect and D3DPOOL

Started by
1 comment, last by remigius 14 years, 1 month ago
Hello, Need help ASAP!! Due tomorrow I want to collect the BackBuffer contents into a Surface in D3DPOOL_DEFAULT Firstly I create an OffscreenSurface with the RenderTarget Surface Descriptor. I then use GetRenderTargetData to capture the contents. This returns S_OK and I can confirm the copy worked by dumping that surface to a BMP file with D3DXSaveSurfaceToFile. However StretchRect states that textures must exist in the D3DPOOL_DEFAULT to operate, and my OffScreenSurface must exist in D3DPOOL_SYSTEMMEM to capture the RenderTarget. I need StretchRect to re-size chunks of the surface... At the moment I have a D3DX loaded texture, lock a surface of that and then tear that into chunks. How do I move my captured screen data onto this surface??? Thanks
Advertisement
Can't you just StretchRect directly from the back buffer to your surface in D3DPOOL_DEFAULT?

Do you actually need your data on the CPU side of things? If not, you could forget about using all these (relatively slow) functions and just use a sprite or something like that to draw parts of your captured screen onto various chunk-sized render targets.
Rim van Wersch [ MDXInfo ] [ XNAInfo ] [ YouTube ] - Do yourself a favor and bookmark this excellent free online D3D/shader book!

This topic is closed to new replies.

Advertisement