本文整理汇总了C++中VRMenuObject::GetHandle方法的典型用法代码示例。如果您正苦于以下问题:C++ VRMenuObject::GetHandle方法的具体用法?C++ VRMenuObject::GetHandle怎么用?C++ VRMenuObject::GetHandle使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类VRMenuObject
的用法示例。
在下文中一共展示了VRMenuObject::GetHandle方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
//==================================
// VRMenuMgrLocal::ToObject
// Return the object for a menu handle.
VRMenuObject * VRMenuMgrLocal::ToObject( menuHandle_t const handle ) const
{
int index;
UInt32 id;
DecomposeHandle( handle, index, id );
if ( id == INVALID_MENU_OBJECT_ID )
{
return NULL;
}
if ( !HandleComponentsAreValid( index, id ) )
{
LOG( "VRMenuMgrLocal::ToObject - invalid handle." );
return NULL;
}
if ( index >= ObjectList.GetSizeI() )
{
LOG( "VRMenuMgrLocal::ToObject - index out of range." );
return NULL;
}
VRMenuObject * object = ObjectList[index];
if ( object == NULL )
{
LOG( "VRMenuMgrLocal::ToObject - slot empty." );
return NULL; // this can happen if someone is holding onto the handle of an object that's been freed
}
if ( object->GetHandle() != handle )
{
// if the handle of the object in the slot does not match, then the object the handle refers to was deleted
// and a new object is in the slot
LOG( "VRMenuMgrLocal::ToObject - slot mismatch." );
return NULL;
}
return object;
}