Overte C++ Documentation
plugins/oculus/src/OculusPlatformPlugin.h
1 //
2 // Created by Wayne Chen on 2019/01/08
3 // Copyright 2019 High Fidelity, Inc.
4 //
5 // Distributed under the Apache License, Version 2.0.
6 // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
7 //
8 #pragma once
9 
10 #include <plugins/OculusPlatformPlugin.h>
11 
12 #include <OVR_CAPI_GL.h>
13 
14 #define OVRPL_DISABLED
15 #include <OVR_Platform.h>
16 
17 class OculusAPIPlugin : public OculusPlatformPlugin {
18 public:
19  OculusAPIPlugin() = default;
20  virtual ~OculusAPIPlugin() = default;
21  QString getName() const { return NAME; }
22  QString getOculusUserID() const { return _user; };
23 
24  bool isRunning() const;
25 
26  bool init();
27 
28  void shutdown();
29 
30  virtual void requestNonceAndUserID(NonceUserIDCallback callback);
31 
32  virtual void handleOVREvents();
33 
34 private:
35  static QString NAME;
36  NonceUserIDCallback _nonceUserIDCallback;
37  QString _nonce;
38  bool _nonceChanged{ false };
39  bool _userIDChanged{ false };
40  QString _user;
41  ovrID _userID;
42  ovrSession _session;
43 };