Beispiel #1
0
void VRController::OnDisplayChanged(device::blink::VRDisplayPtr display) {
  VRDisplay* vrDisplay = getDisplayForIndex(display->index);
  if (!vrDisplay)
    return;

  vrDisplay->update(display);
}
Beispiel #2
0
VRDisplay* VRController::createOrUpdateDisplay(
    const device::blink::VRDisplayPtr& display) {
  VRDisplay* vrDisplay = getDisplayForIndex(display->index);
  if (!vrDisplay) {
    vrDisplay = new VRDisplay(m_navigatorVR);
    m_displays.append(vrDisplay);
  }

  vrDisplay->update(display);
  return vrDisplay;
}
Beispiel #3
0
VRDisplayVector VRDisplayCollection::updateDisplays(mojo::WTFArray<mojom::blink::VRDeviceInfoPtr> devices)
{
    VRDisplayVector vrDevices;

    for (const auto& device : devices.PassStorage()) {
        VRDisplay* display = getDisplayForIndex(device->index);
        if (!display) {
            display = new VRDisplay(m_navigatorVR);
            m_displays.append(display);
        }

        display->update(device);
        vrDevices.append(display);
    }

    return vrDevices;
}