本文整理汇总了C++中LPDIRECTDRAWSURFACE::AddRef方法的典型用法代码示例。如果您正苦于以下问题:C++ LPDIRECTDRAWSURFACE::AddRef方法的具体用法?C++ LPDIRECTDRAWSURFACE::AddRef怎么用?C++ LPDIRECTDRAWSURFACE::AddRef使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LPDIRECTDRAWSURFACE
的用法示例。
在下文中一共展示了LPDIRECTDRAWSURFACE::AddRef方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
// initialization
STDMETHODIMP
CDirect2DRMDevice::InitFromSurface(LPDIRECTDRAWSURFACE pdds)
{
HRESULT hr;
if (pdds == NULL)
return E_NULLPOINTER;
// if (m_pddsBackBuffer)
// return E_ALREADYINITIALIZED;
// release the old surface
MMRELEASE(m_pddsBackBuffer);
pdds->AddRef();
m_pddsBackBuffer = pdds;
if (FAILED(hr = pdds->GetSurfaceDesc(&m_ddsd)) ||
FAILED(hr = m_pixi.Init(m_ddsd.ddpfPixelFormat)))
return hr;
// notify the viewports that the device has been resized
for(DWORD i = 0, cLimit = m_dsViewports.Items(); i < cLimit; i++) {
if (FAILED(hr = m_dsViewports[i]->DeviceResized()))
return hr;
}
return S_OK;
}