本文整理汇总了C++中LPDIRECTDRAW7::RestoreAllSurfaces方法的典型用法代码示例。如果您正苦于以下问题:C++ LPDIRECTDRAW7::RestoreAllSurfaces方法的具体用法?C++ LPDIRECTDRAW7::RestoreAllSurfaces怎么用?C++ LPDIRECTDRAW7::RestoreAllSurfaces使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LPDIRECTDRAW7
的用法示例。
在下文中一共展示了LPDIRECTDRAW7::RestoreAllSurfaces方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: dx_Restaure
//-----------------------------------------------------------------------------
// Name: dx_Restaure()
// Desc: Restaure les objets perdus (s'ils sont perdus)
//-----------------------------------------------------------------------------
void dx_Restaure ()
{
if (SurfacePrimaire->IsLost () != DD_OK)
{
DirectDraw7->RestoreAllSurfaces ();
(*Restaure)();
}
}
示例2: sizeof
BOOL CH264Decode::PreviewDraw(H264_DEC_FRAME_S DecodeData)
{
if (!m_bPreEnable)
{
return true;
}
DDSURFACEDESC2 ddsd;
const HI_U8 *pY = DecodeData.pY;
const HI_U8 *pU = DecodeData.pU;
const HI_U8 *pV = DecodeData.pV;
HI_U32 width = DecodeData.uWidth;
HI_U32 height = DecodeData.uHeight;
HI_U32 yStride = DecodeData.uYStride;
HI_U32 uvStride = DecodeData.uUVStride;
if (0 == width || 0 == height)
{
return true;
}
ZeroMemory(&ddsd,sizeof(DDSURFACEDESC2));
ddsd.dwSize = sizeof(DDSURFACEDESC2);
HRESULT hr;
hr = m_pOffscreenSurface->Lock(NULL,&ddsd,DDLOCK_WAIT | DDLOCK_SURFACEMEMORYPTR,NULL);
if (FAILED(hr))
{
m_dwLastError = hr;//GetLastError();
switch(hr)
{
case DDERR_SURFACELOST:
g_pDirectDraw7->RestoreAllSurfaces();
break;
case DDERR_SURFACEBUSY:
m_pOffscreenSurface->Unlock(NULL);
break;
default:
break;
}
return FALSE;
}
PBYTE pDestY = (PBYTE)ddsd.lpSurface;
PBYTE pDestV = (PBYTE)ddsd.lpSurface + ddsd.lPitch * ddsd.dwHeight;
PBYTE pDestU = (PBYTE)ddsd.lpSurface + ddsd.lPitch * ddsd.dwHeight*5/4;
for (HI_U32 i = 0;i<height;i++)
{
memcpy(pDestY,pY,yStride);
pDestY += ddsd.lPitch;
pY += yStride;
}
for (i = 0;i<height/2;i++)
{
memcpy(pDestU,pU,uvStride);
pDestU += ddsd.lPitch/2;
pU += uvStride;
}
for (i = 0;i<height/2;i++)
{
memcpy(pDestV,pV,uvStride);
pDestV += ddsd.lPitch/2;
pV += uvStride;
}
hr = m_pOffscreenSurface->Unlock(NULL);
EnterCriticalSection(&m_csCritial);
if (m_PlayWnd != NULL)
{
RECT rcDsp;
::GetClientRect( m_PlayWnd,&rcDsp);
POINT ptTL;
POINT ptRB;
ptTL.x = rcDsp.left + 1;
ptTL.y = rcDsp.top + 1;
ptRB.x = rcDsp.right - 1;
ptRB.y = rcDsp.bottom - 1;
::ClientToScreen( m_PlayWnd,&ptTL);
::ClientToScreen( m_PlayWnd,&ptRB);
SetRect(&rcDsp,ptTL.x,ptTL.y,ptRB.x,ptRB.y);
//写OSD
/* HDC dcTemp;
hr = m_pOSDSurface->GetDC(&dcTemp);
DDSURFACEDESC2 ddsdOsd = {0};
ddsdOsd.dwSize = sizeof(ddsdOsd);
m_pOSDSurface->GetSurfaceDesc(&ddsdOsd);
HBRUSH BackBrush = CreateSolidBrush(RGB(0,0,0));
RECT rcOsd;
SetRect(&rcOsd,0,0,ddsdOsd.dwWidth,ddsdOsd.dwHeight);
FillRect(dcTemp,&rcOsd,BackBrush);
DeleteObject(BackBrush);
EnterCriticalSection(&m_csDcCallback);
if (NULL != dccallbackFun)
{
dccallbackFun(dcTemp,m_nDcChl,lpDcUser);
//.........这里部分代码省略.........