Bike-X  0.8
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
CAPI_HMDRenderState.h
Go to the documentation of this file.
1 /************************************************************************************
2 
3 Filename : CAPI_HMDRenderState.h
4 Content : Combines all of the rendering state associated with the HMD
5 Created : February 2, 2014
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_HMDRenderState_h
28 #define OVR_CAPI_HMDRenderState_h
29 
30 #include "../OVR_CAPI.h"
31 #include "../Kernel/OVR_Math.h"
32 #include "../Util/Util_Render_Stereo.h"
33 
34 
35 namespace OVR { namespace CAPI {
36 
37 using namespace OVR::Util::Render;
38 
39 //-------------------------------------------------------------------------------------
40 // ***** HMDRenderState
41 
42 // Combines all of the rendering setup information about one HMD.
43 
45 {
46  // Quiet assignment compiler warning.
47  void operator = (const HMDRenderState&) { }
48 public:
49 
50  HMDRenderState(ovrHmd hmd, Profile* userProfile, const OVR::HMDInfo& hmdInfo);
51  virtual ~HMDRenderState();
52 
53 
54  // *** Rendering Setup
55 
56  // Delegated access APIs
57  ovrHmdDesc GetDesc();
58  ovrSizei GetFOVTextureSize(int eye, ovrFovPort fov, float pixelsPerDisplayPixel);
59 
60  ovrEyeRenderDesc calcRenderDesc(ovrEyeType eyeType, const ovrFovPort& fov);
61 
62  void setupRenderDesc(ovrEyeRenderDesc eyeRenderDescOut[2],
63  const ovrFovPort eyeFovIn[2]);
64 public:
65 
66  // HMDInfo shouldn't change, as its string pointers are passed out.
69 
70  //const char* pLastError;
71 
73  DistortionRenderDesc Distortion[2];
74  ovrEyeRenderDesc EyeRenderDesc[2];
75 
76  // Clear color used for distortion
77  float ClearColor[4];
78 
79  // Pose at which last time the eye was rendered, as submitted by EndEyeRender.
80  ovrPosef EyeRenderPoses[2];
81 
82  // Capabilities passed to Configure.
83  unsigned EnabledHmdCaps;
84  unsigned DistortionCaps;
85 };
86 
87 
88 }} // namespace OVR::CAPI
89 
90 
91 #endif // OVR_CAPI_HMDState_h
92 
93 
ovrEyeType
Definition: OVR_CAPI.h:177
const OVR::HMDInfo & HMDInfo