blob: b86824ef6735000a45375ed2f3ec7e9fc99a0110 [file] [log] [blame]
// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "base/macros.h"
#include "device/vr/vr_client_dispatcher.h"
#include "device/vr/vr_export.h"
#include "device/vr/vr_service.mojom.h"
namespace blink {
struct WebHMDSensorState;
namespace ui {
class BaseWindow;
namespace device {
class VRDeviceProvider;
const unsigned int VR_DEVICE_LAST_ID = 0xFFFFFFFF;
class VRDevice {
DEVICE_VR_EXPORT explicit VRDevice(VRDeviceProvider* provider);
DEVICE_VR_EXPORT virtual ~VRDevice();
DEVICE_VR_EXPORT VRDeviceProvider* provider() const { return provider_; }
DEVICE_VR_EXPORT VRClientDispatcher* client() const { return client_; }
DEVICE_VR_EXPORT unsigned int id() const { return id_; }
virtual VRDisplayPtr GetVRDevice() = 0;
virtual VRPosePtr GetPose() = 0;
virtual void ResetPose() = 0;
virtual void PollEvents() {}
virtual bool RequestPresent(){ return true; };
virtual void ExitPresent(){};
virtual void SubmitFrame(VRPosePtr pose){};
virtual void UpdateLayerBounds(VRLayerBoundsPtr leftBounds,
VRLayerBoundsPtr rightBounds){};
friend class VRDeviceManager;
void SetClient(VRClientDispatcher* client) { client_ = client; }
VRDeviceProvider* provider_;
VRClientDispatcher* client_;
unsigned int id_;
static unsigned int next_id_;
} // namespace device