Jump to content
  • Advertisement
Sign in to follow this  
Zaph-0

Copying Textures in dx9 really fast

This topic is 3760 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 have to copy rectangles from one texture into another and I have to do it really fast. And I have to do it without "stretchrect" because I will have to port it to DX10 and its not available there. The only only way I know how to do this is by making the destination surface a rendertarget and rendering a square (with the sourcetarget) into it. Problem is that there are some pixels differently, some are a little stretched some are a little squished... it's just not the same on a per-pixel level and its very noticeable. I sometimes have to continue copying the copied texture and the glitches get worse and worse... Is there a better (and also fast) way to do this ?

Share this post


Link to post
Share on other sites
Advertisement
In D3D9 you can use StrechtRect.

D3D10 has a function that makes the same thing

ID3D10Device::CopySubresourceRegion
Copy a region from a source resource to a destination resource.

void CopySubresourceRegion(
ID3D10Resource *pDstResource,
UINT DstSubresource,
UINT DstX,
UINT DstY,
UINT DstZ,
ID3D10Resource *pSrcResource,
UINT SrcSubresource,
const D3D10_BOX *pSrcBox
);

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!