Bike-X  0.8
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
CAPI_GlobalState.h
Go to the documentation of this file.
1 /************************************************************************************
2 
3 Filename : CAPI_GlobalState.h
4 Content : Maintains global state of the CAPI
5 Created : January 24, 2013
6 Authors : Michael Antonov
7 
8 Copyright : Copyright 2014 Oculus VR, Inc. All Rights reserved.
9 
10 Licensed under the Oculus VR Rift SDK License Version 3.1 (the "License");
11 you may not use the Oculus VR Rift SDK except in compliance with the License,
12 which is provided at the time of installation or download, or which
13 otherwise accompanies this software in either electronic or hard copy form.
14 
15 You may obtain a copy of the License at
16 
17 http://www.oculusvr.com/licenses/LICENSE-3.1
18 
19 Unless required by applicable law or agreed to in writing, the Oculus VR SDK
20 distributed under the License is distributed on an "AS IS" BASIS,
21 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
22 See the License for the specific language governing permissions and
23 limitations under the License.
24 
25 ************************************************************************************/
26 
27 #ifndef OVR_CAPI_GlobalState_h
28 #define OVR_CAPI_GlobalState_h
29 
30 #include "../OVR_CAPI.h"
31 #include "../OVR_Device.h"
32 #include "../Kernel/OVR_Timer.h"
33 #include "../Kernel/OVR_Math.h"
34 
35 #include "CAPI_HMDState.h"
36 
37 namespace OVR { namespace CAPI {
38 
39 //-------------------------------------------------------------------------------------
40 // ***** OVRGlobalState
41 
42 // Global DeviceManager state - singleton instance of this is created
43 // by ovr_Initialize().
45 {
46 public:
47  GlobalState();
48  ~GlobalState();
49 
51 
52  int EnumerateDevices();
54 
55  // MessageHandler implementation
56  void OnMessage(const Message& msg);
57 
58  // Helpers used to keep track of HMDs and notify them of sensor changes.
59  void AddHMD(HMDState* hmd);
60  void RemoveHMD(HMDState* hmd);
62 
63  const char* GetLastError()
64  {
65  return 0;
66  }
67 
69 
70 protected:
71 
75 
76  // Currently created hmds; protected by Manager lock.
78 };
79 
80 }} // namespace OVR::CAPI
81 
82 #endif
83 
84 
void OnMessage(const Message &msg)
Ptr< DeviceManager > pManager
void AddHMD(HMDState *hmd)
enum _deviceType deviceType
void RemoveHMD(HMDState *hmd)
const char * GetLastError()
void NotifyHMDs_AddDevice(DeviceType deviceType)
DeviceManager * GetManager()
List< HMDState > HMDs
HMDDevice * CreateDevice(int index)
int char * index(const char *__s, int __c) __THROW __attribute_pure__ __nonnull((1))
static GlobalState * pInstance
Array< DeviceHandle > EnumeratedDevices