• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ VRManager类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中VRManager的典型用法代码示例。如果您正苦于以下问题:C++ VRManager类的具体用法?C++ VRManager怎么用?C++ VRManager使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了VRManager类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: IPC_OK

mozilla::ipc::IPCResult
VRManagerParent::RecvCreateVRServiceTestController(const nsCString& aID, const uint32_t& aPromiseID)
{
  uint32_t controllerIdx = 0;
  nsTArray<VRControllerInfo> controllerInfoArray;
  impl::VRControllerPuppet* controllerPuppet = nullptr;
  VRManager* vm = VRManager::Get();

  // Get VRControllerPuppet from VRManager
  vm->GetVRControllerInfo(controllerInfoArray);
  for (auto& controllerInfo : controllerInfoArray) {
    if (controllerInfo.GetType() == VRDeviceType::Puppet) {
      if (controllerIdx == mControllerTestID) {
        controllerPuppet = static_cast<impl::VRControllerPuppet*>(
                           vm->GetController(controllerInfo.GetControllerID()).get());
        break;
      }
      ++controllerIdx;
    }
  }

  MOZ_ASSERT(controllerPuppet);
  MOZ_ASSERT(mControllerTestID < 2); // We have only two controllers in VRSystemManagerPuppet.

  if (!mVRControllerTests.Get(mControllerTestID, nullptr)) {
    mVRControllerTests.Put(mControllerTestID, controllerPuppet);
  }

  if (SendReplyCreateVRServiceTestController(aID, aPromiseID, mControllerTestID)) {
    ++mControllerTestID;
    return IPC_OK();
  }

  return IPC_FAIL(this, "SendReplyCreateVRServiceTestController fail");
}
开发者ID:,项目名称:,代码行数:35,代码来源:


示例2:

void
VRManagerParent::RegisterWithManager()
{
  VRManager* vm = VRManager::Get();
  vm->AddVRManagerParent(this);
  mVRManagerHolder = vm;
}
开发者ID:MichaelKohler,项目名称:gecko-dev,代码行数:7,代码来源:VRManagerParent.cpp


示例3: IPC_OK

mozilla::ipc::IPCResult
VRManagerParent::RecvGetDisplays(nsTArray<VRDisplayInfo> *aDisplays)
{
  VRManager* vm = VRManager::Get();
  vm->GetVRDisplayInfo(*aDisplays);
  return IPC_OK();
}
开发者ID:lazyparser,项目名称:gecko-dev,代码行数:7,代码来源:VRManagerParent.cpp


示例4: IPC_OK

mozilla::ipc::IPCResult
VRManagerParent::RecvStopVibrateHaptic(const uint32_t& aControllerIdx)
{
  VRManager* vm = VRManager::Get();
  vm->StopVibrateHaptic(aControllerIdx);
  return IPC_OK();
}
开发者ID:luke-chang,项目名称:gecko-1,代码行数:7,代码来源:VRManagerParent.cpp


示例5:

bool
VRLayerParent::RecvSubmitFrame(PTextureParent* texture)
{
  VRManager* vm = VRManager::Get();
  vm->SubmitFrame(this, texture, mLeftEyeRect, mRightEyeRect);

  return true;
}
开发者ID:MichaelKohler,项目名称:gecko-dev,代码行数:8,代码来源:VRLayerParent.cpp


示例6: MOZ_ASSERT

void
CompositorVsyncScheduler::DispatchVREvents(TimeStamp aVsyncTimestamp)
{
  MOZ_ASSERT(CompositorThreadHolder::IsInCompositorThread());

  VRManager* vm = VRManager::Get();
  vm->NotifyVsync(aVsyncTimestamp);
}
开发者ID:yrliou,项目名称:gecko-dev,代码行数:8,代码来源:CompositorVsyncScheduler.cpp


示例7: IPC_OK

mozilla::ipc::IPCResult
VRLayerParent::RecvSubmitFrame(PTextureParent* texture)
{
  if (mVRDisplayID) {
    VRManager* vm = VRManager::Get();
    vm->SubmitFrame(this, texture, mLeftEyeRect, mRightEyeRect);
  }

  return IPC_OK();
}
开发者ID:yrliou,项目名称:gecko-dev,代码行数:10,代码来源:VRLayerParent.cpp


示例8: autoLock

void
VRDisplayHost::SubmitFrame(VRLayerParent* aLayer, PTextureParent* aTexture,
                           const gfx::Rect& aLeftEyeRect,
                           const gfx::Rect& aRightEyeRect)
{
  if ((mDisplayInfo.mGroupMask & aLayer->GetGroup()) == 0) {
    // Suppress layers hidden by the group mask
    return;
  }

  TextureHost* th = TextureHost::AsTextureHost(aTexture);
  // WebVR doesn't use the compositor to compose the frame, so use
  // AutoLockTextureHostWithoutCompositor here.
  AutoLockTextureHostWithoutCompositor autoLock(th);
  if (autoLock.Failed()) {
    NS_WARNING("Failed to lock the VR layer texture");
    return;
  }

  CompositableTextureSourceRef source;
  if (!th->BindTextureSource(source)) {
    NS_WARNING("The TextureHost was successfully locked but can't provide a TextureSource");
    return;
  }
  MOZ_ASSERT(source);

  IntSize texSize = source->GetSize();

  TextureSourceD3D11* sourceD3D11 = source->AsSourceD3D11();
  if (!sourceD3D11) {
    NS_WARNING("WebVR support currently only implemented for D3D11");
    return;
  }

  if (!SubmitFrame(sourceD3D11, texSize, aLeftEyeRect, aRightEyeRect)) {
    return;
  }

  /**
   * Trigger the next VSync immediately after we are successfully
   * submitting frames.  As SubmitFrame is responsible for throttling
   * the render loop, if we don't successfully call it, we shouldn't trigger
   * NotifyVRVsync immediately, as it will run unbounded.
   * If NotifyVRVsync is not called here due to SubmitFrame failing, the
   * fallback "watchdog" code in VRDisplayHost::NotifyVSync() will cause
   * frames to continue at a lower refresh rate until frame submission
   * succeeds again.
   */
  VRManager *vm = VRManager::Get();
  MOZ_ASSERT(vm);
  vm->NotifyVRVsync(mDisplayInfo.mDisplayID);
}
开发者ID:,项目名称:,代码行数:52,代码来源:


示例9: StopPresentation

void
VRDisplayHost::RemoveLayer(VRLayerParent *aLayer)
{
    mLayers.RemoveElement(aLayer);
    if (mLayers.Length() == 0) {
        StopPresentation();
    }
    mDisplayInfo.mIsPresenting = mLayers.Length() > 0;

    // Ensure that the content process receives the change immediately
    VRManager* vm = VRManager::Get();
    vm->RefreshVRDisplays();
}
开发者ID:lazyparser,项目名称:gecko-dev,代码行数:13,代码来源:VRDisplayHost.cpp



注:本文中的VRManager类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ VRMenuObject类代码示例发布时间:2022-05-31
下一篇:
C++ VRML_LAYER类代码示例发布时间:2022-05-31
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap