本文整理汇总了C++中PVRSRV_DEVICE_NODE::pfnInitDevice方法的典型用法代码示例。如果您正苦于以下问题:C++ PVRSRV_DEVICE_NODE::pfnInitDevice方法的具体用法?C++ PVRSRV_DEVICE_NODE::pfnInitDevice怎么用?C++ PVRSRV_DEVICE_NODE::pfnInitDevice使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PVRSRV_DEVICE_NODE
的用法示例。
在下文中一共展示了PVRSRV_DEVICE_NODE::pfnInitDevice方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: PVRSRVInitialiseDevice
/*!
******************************************************************************
@Function PVRSRVInitialiseDevice
@Description
initialises device by index
@Input ui32DevIndex : Index to the required device
@Return PVRSRV_ERROR :
******************************************************************************/
PVRSRV_ERROR IMG_CALLCONV PVRSRVInitialiseDevice (IMG_UINT32 ui32DevIndex)
{
PVRSRV_DEVICE_NODE *psDeviceNode;
SYS_DATA *psSysData;
PVRSRV_ERROR eError;
PVR_DPF((PVR_DBG_MESSAGE, "PVRSRVInitialiseDevice"));
SysAcquireData(&psSysData);
/* Find device in the list */
psDeviceNode = (PVRSRV_DEVICE_NODE*)
List_PVRSRV_DEVICE_NODE_Any_va(psSysData->psDeviceNodeList,
&MatchDeviceKM_AnyVaCb,
ui32DevIndex,
IMG_TRUE);
if(!psDeviceNode)
{
/* Devinfo not in the list */
PVR_DPF((PVR_DBG_ERROR,"PVRSRVInitialiseDevice: requested device is not present"));
return PVRSRV_ERROR_INIT_FAILURE;
}
/*
FoundDevice:
*/
PVR_ASSERT (psDeviceNode->ui32RefCount > 0);
/*
Create the device's resource manager context.
*/
eError = PVRSRVResManConnect(IMG_NULL, &psDeviceNode->hResManContext);
if (eError != PVRSRV_OK)
{
PVR_DPF((PVR_DBG_ERROR,"PVRSRVInitialiseDevice: Failed PVRSRVResManConnect call"));
return eError;
}
/* Initialise the device */
if(psDeviceNode->pfnInitDevice != IMG_NULL)
{
eError = psDeviceNode->pfnInitDevice(psDeviceNode);
if (eError != PVRSRV_OK)
{
PVR_DPF((PVR_DBG_ERROR,"PVRSRVInitialiseDevice: Failed InitDevice call"));
return eError;
}
}
return PVRSRV_OK;
}