Original Post
Hello!
I''m getting crazy here... :-) I would like to scroll sprites and pictures smooth over the edge of my window. But if they are painted outside the window the whole sprite or picture disapper. I have tried to use a clipper but without success. The clipper is used on my window and primary buffer, but it does not help. If I use the backbuffer instead the window gets all black! I do like this:
HRESULT CDisplay::InitClipper()
{
LPDIRECTDRAWCLIPPER pClipper;
HRESULT hr;
// Create a clipper when using GDI to draw on the primary surface
if( FAILED( hr = m_pDD->CreateClipper( 0, &pClipper, NULL ) ) )
return hr;
pClipper->SetHWnd( 0, m_hWnd );
if( FAILED( hr = m_pddsFrontBuffer->SetClipper( pClipper ) ) )
return hr;
// We can release the clipper now since g_pDDSPrimary
// now maintains a ref count on the clipper
SAFE_RELEASE( pClipper );
return S_OK;
}
/Mattias