当前位置: 首页>>代码示例>>C++>>正文


C++ VRManager类代码示例

本文整理汇总了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;未经允许,请勿转载。