本文整理汇总了C++中LPDIRECTDRAWSURFACE::SetOverlayPosition方法的典型用法代码示例。如果您正苦于以下问题:C++ LPDIRECTDRAWSURFACE::SetOverlayPosition方法的具体用法?C++ LPDIRECTDRAWSURFACE::SetOverlayPosition怎么用?C++ LPDIRECTDRAWSURFACE::SetOverlayPosition使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LPDIRECTDRAWSURFACE
的用法示例。
在下文中一共展示了LPDIRECTDRAWSURFACE::SetOverlayPosition方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: mfc_render_flip
void mfc_render_flip(void *mfc_render_handle)
{
HRESULT hRet;
_MFC_RENDER_OVERLAY *pMFC_RENDER_OVERLAY;
LPDIRECTDRAWSURFACE pDDSOverlay;
if (mfc_render_handle == NULL) {
PRINT_ERRMSG(TEXT("\nmfc_render_handle is NULL."));
return;
}
pMFC_RENDER_OVERLAY = (_MFC_RENDER_OVERLAY *) mfc_render_handle;
if (pMFC_RENDER_OVERLAY->show == 0) {
RECT rs, rd;
rs.left = 0;
rs.top = 0;
rs.right = pMFC_RENDER_OVERLAY->src_wd;
rs.bottom = pMFC_RENDER_OVERLAY->src_hi;
rd.left = pMFC_RENDER_OVERLAY->x;
rd.top = pMFC_RENDER_OVERLAY->y;
rd.right = pMFC_RENDER_OVERLAY->dst_wd;
rd.bottom = pMFC_RENDER_OVERLAY->dst_hi;
pDDSOverlay = pMFC_RENDER_OVERLAY->pDD;
// Update the overlay parameters.
hRet = pDDSOverlay->UpdateOverlay(&rs, g_pDDSPrimary, &rd, DDOVER_SHOW, NULL);
if (hRet != DD_OK) {
PRINT_ERRMSG(TEXT("Unable to show overlay surface!"));
return;
}
hRet = pDDSOverlay->SetOverlayPosition(0, 0);
if (hRet != DD_OK) {
PRINT_ERRMSG(TEXT("Unable to SetOverlayPosition!"));
return;
}
pMFC_RENDER_OVERLAY->show = 1;
}
if (pMFC_RENDER_OVERLAY->which == 0) {
pMFC_RENDER_OVERLAY->pDD->Flip(NULL, 0);
pMFC_RENDER_OVERLAY->which = 1;
}
else if (pMFC_RENDER_OVERLAY->which == 1) {
pMFC_RENDER_OVERLAY->pDD_back->Flip(NULL, 0);
pMFC_RENDER_OVERLAY->which = 0;
}
}