ovr_sdk

diff 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 diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/LibOVR/Src/CAPI/GL/CAPI_GL_HSWDisplay.h	Wed Jan 14 06:51:16 2015 +0200
     1.3 @@ -0,0 +1,77 @@
     1.4 +/************************************************************************************
     1.5 +
     1.6 +Filename    :   CAPI_GL_HSWDisplay.h
     1.7 +Content     :   Implements Health and Safety Warning system.
     1.8 +Created     :   July 7, 2014
     1.9 +Authors     :   Paul Pedriana
    1.10 +
    1.11 +Copyright   :   Copyright 2014 Oculus VR, LLC All Rights reserved.
    1.12 +
    1.13 +Licensed under the Oculus VR Rift SDK License Version 3.2 (the "License"); 
    1.14 +you may not use the Oculus VR Rift SDK except in compliance with the License, 
    1.15 +which is provided at the time of installation or download, or which 
    1.16 +otherwise accompanies this software in either electronic or hard copy form.
    1.17 +
    1.18 +You may obtain a copy of the License at
    1.19 +
    1.20 +http://www.oculusvr.com/licenses/LICENSE-3.2 
    1.21 +
    1.22 +Unless required by applicable law or agreed to in writing, the Oculus VR SDK 
    1.23 +distributed under the License is distributed on an "AS IS" BASIS,
    1.24 +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    1.25 +See the License for the specific language governing permissions and
    1.26 +limitations under the License.
    1.27 +
    1.28 +************************************************************************************/
    1.29 +
    1.30 +#ifndef OVR_CAPI_GL_HSWDisplay_h
    1.31 +#define OVR_CAPI_GL_HSWDisplay_h
    1.32 +
    1.33 +
    1.34 +#include "../CAPI_HSWDisplay.h"
    1.35 +#include "CAPI_GL_Util.h"
    1.36 +
    1.37 +
    1.38 +namespace OVR { namespace CAPI { namespace GL {
    1.39 +
    1.40 +    class HSWDisplay : public CAPI::HSWDisplay
    1.41 +    {
    1.42 +    public:
    1.43 +        HSWDisplay(ovrRenderAPIType api, ovrHmd hmd, const HMDRenderState& renderState);
    1.44 +
    1.45 +        // Must be called before use. apiConfig is such that:
    1.46 +        //   const ovrGLConfig* config = (const ovrGLConfig*)apiConfig; or
    1.47 +        bool Initialize(const ovrRenderAPIConfig* apiConfig);
    1.48 +        void Shutdown();
    1.49 +        void DisplayInternal();
    1.50 +        void DismissInternal();
    1.51 +
    1.52 +        // Draws the warning to the eye texture(s). This must be done at the end of a 
    1.53 +        // frame but prior to executing the distortion rendering of the eye textures. 
    1.54 +        void RenderInternal(ovrEyeType eye, const ovrTexture* eyeTexture);
    1.55 +
    1.56 +    protected:
    1.57 +        void UnloadGraphics();
    1.58 +        void LoadGraphics();
    1.59 +
    1.60 +        OVR::CAPI::GL::RenderParams        RenderParams;
    1.61 +        OVR::CAPI::GL::Context             GLContext;           // Our prive OpenGL context for drawing.
    1.62 +        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. 
    1.63 +        Ptr<OVR::CAPI::GL::Texture>        pTexture;
    1.64 +        Ptr<OVR::CAPI::GL::ShaderSet>      pShaderSet;
    1.65 +        Ptr<OVR::CAPI::GL::VertexShader>   pVertexShader;
    1.66 +        Ptr<OVR::CAPI::GL::FragmentShader> pFragmentShader;
    1.67 +        Ptr<OVR::CAPI::GL::Buffer>         pVB;
    1.68 +        GLuint                             VAO;                 // Vertex Array Object.
    1.69 +        bool                               VAOInitialized;      // True if the VAO was initialized with vertex buffer data.
    1.70 +        Matrix4f                           OrthoProjection[2];  // Projection for 2D.
    1.71 +
    1.72 +    private:
    1.73 +        OVR_NON_COPYABLE(HSWDisplay)
    1.74 +    };
    1.75 +
    1.76 +}}} // namespace OVR::CAPI::GL
    1.77 +
    1.78 +
    1.79 +#endif // OVR_CAPI_GL_HSWDisplay_h
    1.80 +