ObjectFactory::ObjectFactory(ID3D::Resource& resource) { ID3D::Device* deviceTemp = nullptr; resource.GetDevice(&deviceTemp); _device = moveptr(deviceTemp); _attachedData = InitAttachedData(_device.get()); }
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); }
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); }
intrusive_ptr<CommandList> DeviceContext::ResolveCommandList() { ID3D::CommandList* commandListTemp = nullptr; HRESULT hresult = _underlying->FinishCommandList(FALSE, &commandListTemp); if (SUCCEEDED(hresult) && commandListTemp) { intrusive_ptr<ID3D::CommandList> underlyingCommandList = moveptr(commandListTemp); return make_intrusive<CommandList>(underlyingCommandList.get()); } return intrusive_ptr<CommandList>(); }