Archived

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

Clearing a texture

This topic is 5648 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, Is there a better, and far faster way, of clearing a texture than this:
  
for(int y=0; y<texYsize; y++)
{
   int offset = y*Pitch;
   memset(pTexture + offset,0,bytesperpixel*texXsize);
}
  
so as not to interfere with whatever directx puts at the end of each line? Or is it okay to overwrite it? Thanks alot, --Helicon56. [edited by - helicon56 on June 25, 2002 7:40:41 PM]

Share this post


Link to post
Share on other sites
Guest Anonymous Poster

HRESULT hr;
DDBLTFX ddbltfx;

ZeroMemory(&ddbltfx, sizeof(ddbltfx));
ddbltfx.dwSize = sizeof(ddbltfx);
ddbltfx.dwFillColor = KEYCOLOR;
hr = pTexture->Blt(NULL, NULL, NULL, DDBLT_WAIT | DDBLT_COLORFILL, &ddbltfx);


i used DirectDraw7 hardware clear (maybe), very fast.

Made In Taiwan, Republic Of China.

Share this post


Link to post
Share on other sites
Thanks for your reply, but I''m talking about Direct 3D here. As far as i know, there''s no Blt function in LPDIREC3DTEXTURE8. So anymore suggestions?
Or is my suggestion the only way?

Share this post


Link to post
Share on other sites