Jump to content
  • Advertisement
Sign in to follow this  
morte0815

paint textures at runtime

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

i am new to directx and i have a hopefully simple question. i generate some textures which should be sourceparts for other textures. i want to compose the final textures from those source parts. here is the code i have written but it does not work: m_pTexTile[ number ] ->LockRect(0, &oTextureLock, &m_pRectRight,0); m_pTexPartsRot[ right ]->LockRect(0, &oPartLock, NULL, 0); pVec4Texture = (D3DXVECTOR4*)oTextureLock.pBits; pVec4Part = (D3DXVECTOR4*)oPartLock.pBits; for (int i = 0; i < m_iD * 2 * m_iK ; i++) { pVec4Texture = pVec4Part; } m_pTexTile[number]->UnlockRect(0); m_pTexPartsRot

->UnlockRect(0); as you see it locks in the complete sourcetexture, and the rect of the destination texture where the source texture should be pasted to. then it copies all the data from the source to the destination and unlocks both. thanks in advance Morte

Share this post


Link to post
Share on other sites
Advertisement
if i fill a rectangular area this way for example in the middle of the texture then not all the area is filled but like half of the area. at the sides where no pixel should be changed (outside the destistination rectangle) pixels are changed.

all the changed pixels build one thick line over the texture. it looks as if the misplaced pixels are the ones that are needed to fill the rest of the rectangle.

tia

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!