paint textures at runtime

Started by
1 comment, last by morte0815 18 years, 12 months ago
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

Advertisement
What do you mean by 'it does not work?' What's going wrong?

Richard "Superpig" Fine - saving pigs from untimely fates - Microsoft DirectX MVP 2006/2007/2008/2009
"Shaders are not meant to do everything. Of course you can try to use it for everything, but it's like playing football using cabbage." - MickeyMouse

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

This topic is closed to new replies.

Advertisement