本文整理汇总了C++中DeviceContext::GetUnderlying方法的典型用法代码示例。如果您正苦于以下问题:C++ DeviceContext::GetUnderlying方法的具体用法?C++ DeviceContext::GetUnderlying怎么用?C++ DeviceContext::GetUnderlying使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DeviceContext
的用法示例。
在下文中一共展示了DeviceContext::GetUnderlying方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: moveptr
DepthStencilView::DepthStencilView(DeviceContext& context)
{
// get the currently bound depth stencil view from the context
ID3D::DepthStencilView* rawPtr = nullptr;
context.GetUnderlying()->OMGetRenderTargets(0, nullptr, &rawPtr);
_underlying = moveptr(rawPtr);
}
示例2: moveptr
IndexBuffer::IndexBuffer(DeviceContext& context)
{
ID3D::Buffer* rawPtr = nullptr;
DXGI_FORMAT fmt = DXGI_FORMAT_UNKNOWN;
unsigned offset = 0;
context.GetUnderlying()->IAGetIndexBuffer(&rawPtr, &fmt, &offset);
_underlying = moveptr(rawPtr);
}
示例3: XlCopyMemory
void ConstantBuffer::Update(DeviceContext& context, const void* data, size_t byteCount)
{
// context.GetUnderlying()->UpdateSubresource(
// _underlying, 0, nullptr, data, byteCount, byteCount);
D3D11_MAPPED_SUBRESOURCE result;
ID3D::DeviceContext* devContext = context.GetUnderlying();
HRESULT hresult = devContext->Map(_underlying.get(), 0, D3D11_MAP_WRITE_DISCARD, 0, &result);
if (SUCCEEDED(hresult) && result.pData) {
XlCopyMemory(result.pData, data, byteCount);
devContext->Unmap(_underlying.get(), 0);
}
}