Original Post
Hey guys, I am using c++ and directx9.0c in my application. I have a texture and I would like to paint all of the texture area to a certain color. Here is my code: D3DLOCKED_RECT locked; D3DSURFACE_DESC desc; HRESULT hr = m_texture->GetLevelDesc(0, &desc); hr = m_texture->LockRect(0, &locked, NULL, D3DLOCK_NOSYSLOCK); D3DCOLOR* buffer = (D3DCOLOR*)locked.pBits; D3DCOLOR count = (desc.Width * desc.Height); for (D3DCOLOR i = 0; i < count; i++) { buffer = color; // filling color value to buffer } hr = m_texture->UnlockRect(0); But whatever I do the background is WHITE! So what's the problem? Any help would be appriciated! THANX!