// d3dumddi.h
PFND3DDDI_PRESENTCB Pfnd3dddiPresentcb;
HRESULT Pfnd3dddiPresentcb(
HANDLE hDevice,
D3DDDICB_PRESENT *unnamedParam2
)
{...}
View the official Windows Driver Kit DDI referenceNo description available.
The pfnPresentCb function copies content from a source allocation.
hDeviceA handle to a display device (graphics context).
unnamedParam2pData [in]
A pointer to a D3DDDICB_PRESENT structure that describes the source allocation that content is copied from.
pfnPresentCb returns one of the following values:
| Return code | Description |
|---|---|
| S_OK | Content was successfully copied. |
| E_OUTOFMEMORY | pfnPresentCb could not complete because of insufficient memory. |
| E_INVALIDARG | Parameters were validated and determined to be incorrect. |
This function might also return other HRESULT values.
The user-mode display driver sets the hContext member of the D3DDDICB_PRESENT structure that is pointed to by the pData parameter to a context that it previously created by calling the pfnCreateContextCb function. The user-mode display driver must create at least one context when the Microsoft Direct3D runtime calls the driver's CreateDevice or CreateDevice(D3D10) function to create a device. The Direct3D runtime sends the present operation to a created context.
Direct3D Version 11 Note: For more information about how the driver calls pfnPresentCb, see Changes from Direct3D 10.
The following code example shows how to color-fill a destination surface.
HRESULT hr=S_OK;
// A color-fill request that does not have a source surface
D3DDDICB_PRESENT PresentCBData = {0};
PresentCBData.hContext = m_sContexts[MULTI_ENGINE_NODE_3D].hContext;
PresentCBData.hSrcAllocation = NULL;
if (pPresent->hDstResource) {
DWORD dwDstSurf = ((DWORD)(DWORD_PTR)pPresent->hDstResource) + pPresent->DstSubResourceIndex;
_ASSERT(dwDstSurf < m_RTbl.Size());
m_RTbl[dwDstSurf].m_qwBatch = m_qwBatch;
PresentCBData.hDstAllocation = R200GetSurfaceAllocHandle(m_pR200Ctx, dwDstSurf);
}
hr = m_d3dCallbacks.pfnPresentCb(m_hD3D, &PresentCBData);
return hr;