Sign in to follow this  

Render Targets - locking and unlocking - giving a new surface

This topic is 4259 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

Hi, I'm using a render target texture. I read the documentation and it said I wasn't allowed to lock textures what we render targets, so instead I use CreateOffscreenPlainSurface, and get the surface off the texture, use GetRenderTargetData to transfer the memory over, and i lock the offscreen surface and i can successfully access all the pixels :) It works a treat! However..I cannot modify the pixels...because its not on the same surface as the render target. Is there a way of reapplying the new pixels on this offscreen surface so I can modify the render target texture ? I just cant think of a way of using the surface at all....there doesn't seem to be any functions that let u give surfaces to textures. Any ideas :) ? Thanks

Share this post


Link to post
Share on other sites
Why are you trying to do that? I can't think of any situation that you'd need to lock a render target, aside from doing screenshots. And if that's the case, you can use StretchRect to copy to another surface.

Share this post


Link to post
Share on other sites
IDirect3DDevice9::UpdateSurface() should do the trick - it'll copy from an offscreen surface in D3DPOOL_SYSTEMMEM to a render target texture in D3DPOOL_DEFAULT.

Although, as Steve pointed out - it's highly unlikely to be a fast operation [wink]

hth
Jack

Share this post


Link to post
Share on other sites

This topic is 4259 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this