blob: ba80852de7f4359a10fb5220b5c1a127d87242d6 [file] [log] [blame]
// Copyright 2018 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/memory/scoped_refptr.h"
#include "device/vr/vr_export.h"
#include "third_party/openvr/src/headers/openvr.h"
namespace base {
class SingleThreadTaskRunner;
namespace device {
class VRTestHook;
class TestHookRegistration;
class OpenVRWrapper {
OpenVRWrapper(bool for_rendering);
bool IsInitialized() { return initialized_; }
// Gets the OpenVR API objects.
// Ensures that they are used in a single thread at a time.
vr::IVRCompositor* GetCompositor();
vr::IVRSystem* GetSystem();
static void DEVICE_VR_EXPORT SetTestHook(VRTestHook* hook);
bool Initialize(bool for_rendering);
void Uninitialize();
vr::IVRSystem* system_ = nullptr;
vr::IVRCompositor* compositor_ = nullptr;
scoped_refptr<base::SingleThreadTaskRunner> current_task_runner_;
bool initialized_ = false;
static TestHookRegistration* test_hook_registration_;
static VRTestHook* test_hook_;
static bool any_initialized_;
std::string GetOpenVRString(vr::IVRSystem* vr_system,
vr::TrackedDeviceProperty prop);
} // namespace device