Jump to content
  • Advertisement


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


copying RECT form Texture

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

this is my code. i wan to copy a piece of texture in an other. i''m using memcopy. my code don''t work . why ?? when drawing nothing is to see. HRESULT Failure; D3DLOCKED_RECT LkRect1; D3DLOCKED_RECT LkRect2; Failure = pTexture->LockRect( 0, &LkRect1, &( SpritesCoordinates[ SpriteNum ] ), D3DLOCK_NOSYSLOCK ); Failure = g_pd3dDevice->CreateTexture( 64, 64, 0, NULL, D3DFMT_A8R8G8B8, D3DPOOL_MANAGED, &pSpriteTexture ); Failure = pSpriteTexture->LockRect( 0, &LkRect2, NULL , D3DLOCK_NOSYSLOCK ); // Kopieren der Pixel BYTE* pData1 = ( BYTE* )( LkRect1.pBits ); BYTE* pData2 = ( BYTE* )( LkRect2.pBits ); memcpy( pData2, pData1, 64 * 64 * BYTESPERPIXEL ); // Unlocken der Texturen Failure = pTexture->UnlockRect( 0 ); pSprite->Begin(); Failure = pSprite->Draw(pSpriteTexture, NULL, &Scaling, &RotCenter, Rotation, &Translation, ModulateColor); pSprite->End();

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.

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!