ovr_sdk

annotate 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
rev   line source
nuclear@0 1 /************************************************************************************
nuclear@0 2
nuclear@0 3 Filename : CAPI_GL_HSWDisplay.h
nuclear@0 4 Content : Implements Health and Safety Warning system.
nuclear@0 5 Created : July 7, 2014
nuclear@0 6 Authors : Paul Pedriana
nuclear@0 7
nuclear@0 8 Copyright : Copyright 2014 Oculus VR, LLC All Rights reserved.
nuclear@0 9
nuclear@0 10 Licensed under the Oculus VR Rift SDK License Version 3.2 (the "License");
nuclear@0 11 you may not use the Oculus VR Rift SDK except in compliance with the License,
nuclear@0 12 which is provided at the time of installation or download, or which
nuclear@0 13 otherwise accompanies this software in either electronic or hard copy form.
nuclear@0 14
nuclear@0 15 You may obtain a copy of the License at
nuclear@0 16
nuclear@0 17 http://www.oculusvr.com/licenses/LICENSE-3.2
nuclear@0 18
nuclear@0 19 Unless required by applicable law or agreed to in writing, the Oculus VR SDK
nuclear@0 20 distributed under the License is distributed on an "AS IS" BASIS,
nuclear@0 21 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
nuclear@0 22 See the License for the specific language governing permissions and
nuclear@0 23 limitations under the License.
nuclear@0 24
nuclear@0 25 ************************************************************************************/
nuclear@0 26
nuclear@0 27 #ifndef OVR_CAPI_GL_HSWDisplay_h
nuclear@0 28 #define OVR_CAPI_GL_HSWDisplay_h
nuclear@0 29
nuclear@0 30
nuclear@0 31 #include "../CAPI_HSWDisplay.h"
nuclear@0 32 #include "CAPI_GL_Util.h"
nuclear@0 33
nuclear@0 34
nuclear@0 35 namespace OVR { namespace CAPI { namespace GL {
nuclear@0 36
nuclear@0 37 class HSWDisplay : public CAPI::HSWDisplay
nuclear@0 38 {
nuclear@0 39 public:
nuclear@0 40 HSWDisplay(ovrRenderAPIType api, ovrHmd hmd, const HMDRenderState& renderState);
nuclear@0 41
nuclear@0 42 // Must be called before use. apiConfig is such that:
nuclear@0 43 // const ovrGLConfig* config = (const ovrGLConfig*)apiConfig; or
nuclear@0 44 bool Initialize(const ovrRenderAPIConfig* apiConfig);
nuclear@0 45 void Shutdown();
nuclear@0 46 void DisplayInternal();
nuclear@0 47 void DismissInternal();
nuclear@0 48
nuclear@0 49 // Draws the warning to the eye texture(s). This must be done at the end of a
nuclear@0 50 // frame but prior to executing the distortion rendering of the eye textures.
nuclear@0 51 void RenderInternal(ovrEyeType eye, const ovrTexture* eyeTexture);
nuclear@0 52
nuclear@0 53 protected:
nuclear@0 54 void UnloadGraphics();
nuclear@0 55 void LoadGraphics();
nuclear@0 56
nuclear@0 57 OVR::CAPI::GL::RenderParams RenderParams;
nuclear@0 58 OVR::CAPI::GL::Context GLContext; // Our prive OpenGL context for drawing.
nuclear@0 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.
nuclear@0 60 Ptr<OVR::CAPI::GL::Texture> pTexture;
nuclear@0 61 Ptr<OVR::CAPI::GL::ShaderSet> pShaderSet;
nuclear@0 62 Ptr<OVR::CAPI::GL::VertexShader> pVertexShader;
nuclear@0 63 Ptr<OVR::CAPI::GL::FragmentShader> pFragmentShader;
nuclear@0 64 Ptr<OVR::CAPI::GL::Buffer> pVB;
nuclear@0 65 GLuint VAO; // Vertex Array Object.
nuclear@0 66 bool VAOInitialized; // True if the VAO was initialized with vertex buffer data.
nuclear@0 67 Matrix4f OrthoProjection[2]; // Projection for 2D.
nuclear@0 68
nuclear@0 69 private:
nuclear@0 70 OVR_NON_COPYABLE(HSWDisplay)
nuclear@0 71 };
nuclear@0 72
nuclear@0 73 }}} // namespace OVR::CAPI::GL
nuclear@0 74
nuclear@0 75
nuclear@0 76 #endif // OVR_CAPI_GL_HSWDisplay_h
nuclear@0 77