ovr_sdk

view LibOVR/Src/CAPI/GL/CAPI_GL_HSWDisplay.h @ 0:1b39a1b46319

initial 0.4.4
author John Tsiombikas <nuclear@member.fsf.org>
date Wed, 14 Jan 2015 06:51:16 +0200
parents
children
line source
1 /************************************************************************************
3 Filename : CAPI_GL_HSWDisplay.h
4 Content : Implements Health and Safety Warning system.
5 Created : July 7, 2014
6 Authors : Paul Pedriana
8 Copyright : Copyright 2014 Oculus VR, LLC All Rights reserved.
10 Licensed under the Oculus VR Rift SDK License Version 3.2 (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.
15 You may obtain a copy of the License at
17 http://www.oculusvr.com/licenses/LICENSE-3.2
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.
25 ************************************************************************************/
27 #ifndef OVR_CAPI_GL_HSWDisplay_h
28 #define OVR_CAPI_GL_HSWDisplay_h
31 #include "../CAPI_HSWDisplay.h"
32 #include "CAPI_GL_Util.h"
35 namespace OVR { namespace CAPI { namespace GL {
37 class HSWDisplay : public CAPI::HSWDisplay
38 {
39 public:
40 HSWDisplay(ovrRenderAPIType api, ovrHmd hmd, const HMDRenderState& renderState);
42 // Must be called before use. apiConfig is such that:
43 // const ovrGLConfig* config = (const ovrGLConfig*)apiConfig; or
44 bool Initialize(const ovrRenderAPIConfig* apiConfig);
45 void Shutdown();
46 void DisplayInternal();
47 void DismissInternal();
49 // Draws the warning to the eye texture(s). This must be done at the end of a
50 // frame but prior to executing the distortion rendering of the eye textures.
51 void RenderInternal(ovrEyeType eye, const ovrTexture* eyeTexture);
53 protected:
54 void UnloadGraphics();
55 void LoadGraphics();
57 OVR::CAPI::GL::RenderParams RenderParams;
58 OVR::CAPI::GL::Context GLContext; // Our prive OpenGL context for drawing.
59 GLuint FrameBuffer; // This is a container for a texture, depth buffer, stencil buffer to be rendered to. To consider: Make a wrapper class, like the OculusWorldDemo RBuffer class.
60 Ptr<OVR::CAPI::GL::Texture> pTexture;
61 Ptr<OVR::CAPI::GL::ShaderSet> pShaderSet;
62 Ptr<OVR::CAPI::GL::VertexShader> pVertexShader;
63 Ptr<OVR::CAPI::GL::FragmentShader> pFragmentShader;
64 Ptr<OVR::CAPI::GL::Buffer> pVB;
65 GLuint VAO; // Vertex Array Object.
66 bool VAOInitialized; // True if the VAO was initialized with vertex buffer data.
67 Matrix4f OrthoProjection[2]; // Projection for 2D.
69 private:
70 OVR_NON_COPYABLE(HSWDisplay)
71 };
73 }}} // namespace OVR::CAPI::GL
76 #endif // OVR_CAPI_GL_HSWDisplay_h