How do you fill a surface (LPDIRECTDRAWSURFACE7) with only one color? It seems like a waste of memory to create a 640x480 bitmap containing one color :)
Printable View
How do you fill a surface (LPDIRECTDRAWSURFACE7) with only one color? It seems like a waste of memory to create a 640x480 bitmap containing one color :)
Taken directly from the MS helper classes and assumes you're using DirectDraw. dwColor is the colour (suprise, suprise). Just flip your backbuffer (m_pddsBackBuffer).Code:DDBLTFX ddbltfx;
ZeroMemory( &ddbltfx, sizeof(ddbltfx) );
ddbltfx.dwSize = sizeof(ddbltfx);
ddbltfx.dwFillColor = dwColor;
m_pddsBackBuffer->Blt( NULL, NULL, NULL, DDBLT_COLORFILL, &ddbltfx );
It works, thanks :)