本文整理汇总了C++中IDirect3DDevice9::EndStateBlock方法的典型用法代码示例。如果您正苦于以下问题:C++ IDirect3DDevice9::EndStateBlock方法的具体用法?C++ IDirect3DDevice9::EndStateBlock怎么用?C++ IDirect3DDevice9::EndStateBlock使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IDirect3DDevice9
的用法示例。
在下文中一共展示了IDirect3DDevice9::EndStateBlock方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: saveState
void Blit::saveState()
{
IDirect3DDevice9 *device = getDevice();
HRESULT hr;
device->GetDepthStencilSurface(&mSavedDepthStencil);
device->GetRenderTarget(0, &mSavedRenderTarget);
if (mSavedStateBlock == NULL)
{
hr = device->BeginStateBlock();
ASSERT(SUCCEEDED(hr) || hr == D3DERR_OUTOFVIDEOMEMORY || hr == E_OUTOFMEMORY);
setCommonBlitState();
static const float dummyConst[4] = { 0, 0, 0, 0 };
device->SetVertexShader(NULL);
device->SetVertexShaderConstantF(0, dummyConst, 1);
device->SetPixelShader(NULL);
device->SetPixelShaderConstantF(0, dummyConst, 1);
D3DVIEWPORT9 dummyVp;
dummyVp.X = 0;
dummyVp.Y = 0;
dummyVp.Width = 1;
dummyVp.Height = 1;
dummyVp.MinZ = 0;
dummyVp.MaxZ = 1;
device->SetViewport(&dummyVp);
device->SetTexture(0, NULL);
device->SetStreamSource(0, mQuadVertexBuffer, 0, 0);
device->SetVertexDeclaration(mQuadVertexDeclaration);
hr = device->EndStateBlock(&mSavedStateBlock);
ASSERT(SUCCEEDED(hr) || hr == D3DERR_OUTOFVIDEOMEMORY || hr == E_OUTOFMEMORY);
}
ASSERT(mSavedStateBlock != NULL);
if (mSavedStateBlock != NULL)
{
hr = mSavedStateBlock->Capture();
ASSERT(SUCCEEDED(hr));
}
}