Advertisement

Garbage showing on surface

Started by November 11, 1999 04:36 AM
1 comment, last by frizb 25 years, 2 months ago
An idea would be to make sure and clear the backbuffer at the beginning of each frame, before you draw anything. Something like this would do it:


DDBLTFX ddbltfx;
ddbltfx.dwSize = sizeof(ddbltfx);
ddbltfx.dwFillColor = 0L;

lpDDSBack->Blt(NULL, NULL, NULL, DDBLT_COLORFILL, &ddbltfx);

That'll be trouble if you're trying to keep all your polygons onscreen, but should work otherwise.

Jonathan


I'm just doing a simple blt and flip with a primary surface and back buffer. I blit a random colored rectangle to the back surface and then flip. The problem I'm having is that every other flip shows parts of my workspace in the background. I'm assuming that I'm not clearing a surface properly, but I've tried everything I've seen on these boards and from the books I have.

I have this before my initial surface creations which are declared with the Caps,complex, and flip flags.
//////////////////////////////////
memset(&ddsd, 0, sizeof(ddsd));
ddsd.dwSize = sizeof(ddsd);
/////////////////////////////////
then after the primary surface has been created I zero out the ddsCaps structure the same as above except with (ddsCaps).

Is there something else I have to do to get rid of the garbage?

------------------
Still Learning...

Still Learning...
Advertisement
Thanks Jonathon. I'll give it a whirl and see how it goes.
Still Learning...

This topic is closed to new replies.

Advertisement