本文整理汇总了C++中Pass::Apply方法的典型用法代码示例。如果您正苦于以下问题:C++ Pass::Apply方法的具体用法?C++ Pass::Apply怎么用?C++ Pass::Apply使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Pass
的用法示例。
在下文中一共展示了Pass::Apply方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ProcessNextPass
void Technique::ProcessNextPass(IGraphicsDevice *device, RenderState &state)
{
if(mPasses.size() > mCurrentPass) {
Pass *pass = mPasses[mCurrentPass];
pass->Apply(device, state);
mCurrentPass++;
}
}
示例2: Draw
void MaterialDemo::Draw(const GameTime& gameTime)
{
ID3D11DeviceContext* direct3DDeviceContext = mGame->Direct3DDeviceContext();
direct3DDeviceContext->IASetPrimitiveTopology(D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST);
Pass* pass = mBasicMaterial->CurrentTechnique()->Passes().at(0);
ID3D11InputLayout* inputLayout = mBasicMaterial->InputLayouts().at(pass);
direct3DDeviceContext->IASetInputLayout(inputLayout);
UINT stride = mBasicMaterial->VertexSize();
UINT offset = 0;
direct3DDeviceContext->IASetVertexBuffers(0, 1, &mVertexBuffer, &stride, &offset);
direct3DDeviceContext->IASetIndexBuffer(mIndexBuffer, DXGI_FORMAT_R32_UINT, 0);
XMMATRIX worldMatrix = XMLoadFloat4x4(&mWorldMatrix);
XMMATRIX wvp = worldMatrix * mCamera->ViewMatrix() * mCamera->ProjectionMatrix();
mBasicMaterial->WorldViewProjection() << wvp;
pass->Apply(0, direct3DDeviceContext);
direct3DDeviceContext->DrawIndexed(mIndexCount, 0, 0);
}