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![]()
This is a discussion on DirectX surface question within the C++ Programming forums, part of the General Programming Boards category; How do you fill a surface (LPDIRECTDRAWSURFACE7) with only one color? It seems like a waste of memory to create ...
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![]()
MagosX.com
Give a man a fish and you feed him for a day.
Teach a man to fish and you feed him for a lifetime.
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![]()
MagosX.com
Give a man a fish and you feed him for a day.
Teach a man to fish and you feed him for a lifetime.