本文整理汇总了C++中IDirect3DQuery9::Release方法的典型用法代码示例。如果您正苦于以下问题:C++ IDirect3DQuery9::Release方法的具体用法?C++ IDirect3DQuery9::Release怎么用?C++ IDirect3DQuery9::Release使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IDirect3DQuery9
的用法示例。
在下文中一共展示了IDirect3DQuery9::Release方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SetupDraw
int
D3DOverdrawWindow::
Loop(void)
{
int nOverdraw = 0;
IDirect3DQuery9* pOcclusionQuery;
DWORD numberOfPixelsDrawn;
d3d->CreateQuery(D3DQUERYTYPE_OCCLUSION, &pOcclusionQuery);
for (unsigned int iViewpoint = 0; iViewpoint < m_nViewpointCount;
iViewpoint++)
{
// Add an end marker to the command buffer queue.
pOcclusionQuery->Issue(D3DISSUE_BEGIN);
// Draw scene
SetupDraw(iViewpoint);
DrawModel();
d3d->EndScene();
d3d->Present(NULL, NULL, NULL, NULL);
// Add an end marker to the command buffer queue.
pOcclusionQuery->Issue(D3DISSUE_END);
// Force the driver to execute the commands from the command buffer.
// Empty the command buffer and wait until the GPU is idle.
while (S_FALSE == pOcclusionQuery->GetData(&numberOfPixelsDrawn,
sizeof(DWORD), D3DGETDATA_FLUSH))
;
nOverdraw += numberOfPixelsDrawn;
}
pOcclusionQuery->Release();
return nOverdraw;
}
示例2: getOcclusionQuerySupport
bool Display::getOcclusionQuerySupport() const
{
if (!isInitialized())
{
return false;
}
IDirect3DQuery9 *query = NULL;
HRESULT result = mDevice->CreateQuery(D3DQUERYTYPE_OCCLUSION, &query);
if (SUCCEEDED(result) && query)
{
query->Release();
return true;
}
else
{
return false;
}
}