clear primary surf to black after creation

This commit is contained in:
georges 2000-11-29 03:30:17 +00:00
parent 03861526f2
commit ce27f60dee

View File

@ -1407,6 +1407,17 @@ dx_setup()
exit(1); exit(1);
} }
// Clear the primary surface to black
DX_DECLARE_CLEAN(DDBLTFX, bltfx)
hr = pPrimaryDDSurf->Blt(NULL,NULL,NULL,DDBLT_COLORFILL | DDBLT_WAIT,&bltfx);
if( FAILED( hr )) {
wdxdisplay_cat.fatal()
<< "wdxGraphicsWindow:: Blt to Black of Primary Surf failed! : result = " << ConvD3DErrorToString(hr) << endl;
exit(1);
}
// Get the backbuffer, which was created along with the primary. // Get the backbuffer, which was created along with the primary.
DDSCAPS2 ddscaps = { DDSCAPS_BACKBUFFER, 0, 0, 0 }; DDSCAPS2 ddscaps = { DDSCAPS_BACKBUFFER, 0, 0, 0 };
if( FAILED( hr = pPrimaryDDSurf->GetAttachedSurface( &ddscaps, &pBackDDSurf ) ) ) if( FAILED( hr = pPrimaryDDSurf->GetAttachedSurface( &ddscaps, &pBackDDSurf ) ) )
@ -1483,6 +1494,16 @@ dx_setup()
pPrimaryDDSurf->SetClipper( Clipper ); pPrimaryDDSurf->SetClipper( Clipper );
Clipper->Release(); Clipper->Release();
// Clear the primary surface to black
DX_DECLARE_CLEAN(DDBLTFX, bltfx)
hr = pPrimaryDDSurf->Blt(NULL,NULL,NULL,DDBLT_COLORFILL | DDBLT_WAIT,&bltfx);
if( FAILED( hr )) {
wdxdisplay_cat.fatal()
<< "wdxGraphicsWindow:: Blt to Black of Primary Surf failed! : result = " << ConvD3DErrorToString(hr) << endl;
exit(1);
}
// Setup a surface description to create a backbuffer. // Setup a surface description to create a backbuffer.
SurfaceDesc.dwFlags = DDSD_WIDTH | DDSD_HEIGHT | DDSD_CAPS; SurfaceDesc.dwFlags = DDSD_WIDTH | DDSD_HEIGHT | DDSD_CAPS;
SurfaceDesc.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN | DDSCAPS_3DDEVICE | DDSCAPS_VIDEOMEMORY; SurfaceDesc.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN | DDSCAPS_3DDEVICE | DDSCAPS_VIDEOMEMORY;