nuclear@0: /************************************************************************************ nuclear@0: nuclear@0: Filename : CAPI_GL_HSWDisplay.h nuclear@0: Content : Implements Health and Safety Warning system. nuclear@0: Created : July 7, 2014 nuclear@0: Authors : Paul Pedriana nuclear@0: nuclear@0: Copyright : Copyright 2014 Oculus VR, LLC All Rights reserved. nuclear@0: nuclear@0: Licensed under the Oculus VR Rift SDK License Version 3.2 (the "License"); nuclear@0: you may not use the Oculus VR Rift SDK except in compliance with the License, nuclear@0: which is provided at the time of installation or download, or which nuclear@0: otherwise accompanies this software in either electronic or hard copy form. nuclear@0: nuclear@0: You may obtain a copy of the License at nuclear@0: nuclear@0: http://www.oculusvr.com/licenses/LICENSE-3.2 nuclear@0: nuclear@0: Unless required by applicable law or agreed to in writing, the Oculus VR SDK nuclear@0: distributed under the License is distributed on an "AS IS" BASIS, nuclear@0: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. nuclear@0: See the License for the specific language governing permissions and nuclear@0: limitations under the License. nuclear@0: nuclear@0: ************************************************************************************/ nuclear@0: nuclear@0: #ifndef OVR_CAPI_GL_HSWDisplay_h nuclear@0: #define OVR_CAPI_GL_HSWDisplay_h nuclear@0: nuclear@0: nuclear@0: #include "../CAPI_HSWDisplay.h" nuclear@0: #include "CAPI_GL_Util.h" nuclear@0: nuclear@0: nuclear@0: namespace OVR { namespace CAPI { namespace GL { nuclear@0: nuclear@0: class HSWDisplay : public CAPI::HSWDisplay nuclear@0: { nuclear@0: public: nuclear@0: HSWDisplay(ovrRenderAPIType api, ovrHmd hmd, const HMDRenderState& renderState); nuclear@0: nuclear@0: // Must be called before use. apiConfig is such that: nuclear@0: // const ovrGLConfig* config = (const ovrGLConfig*)apiConfig; or nuclear@0: bool Initialize(const ovrRenderAPIConfig* apiConfig); nuclear@0: void Shutdown(); nuclear@0: void DisplayInternal(); nuclear@0: void DismissInternal(); nuclear@0: nuclear@0: // Draws the warning to the eye texture(s). This must be done at the end of a nuclear@0: // frame but prior to executing the distortion rendering of the eye textures. nuclear@0: void RenderInternal(ovrEyeType eye, const ovrTexture* eyeTexture); nuclear@0: nuclear@0: protected: nuclear@0: void UnloadGraphics(); nuclear@0: void LoadGraphics(); nuclear@0: nuclear@0: OVR::CAPI::GL::RenderParams RenderParams; nuclear@0: OVR::CAPI::GL::Context GLContext; // Our prive OpenGL context for drawing. nuclear@0: 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: Ptr pTexture; nuclear@0: Ptr pShaderSet; nuclear@0: Ptr pVertexShader; nuclear@0: Ptr pFragmentShader; nuclear@0: Ptr pVB; nuclear@0: GLuint VAO; // Vertex Array Object. nuclear@0: bool VAOInitialized; // True if the VAO was initialized with vertex buffer data. nuclear@0: Matrix4f OrthoProjection[2]; // Projection for 2D. nuclear@0: nuclear@0: private: nuclear@0: OVR_NON_COPYABLE(HSWDisplay) nuclear@0: }; nuclear@0: nuclear@0: }}} // namespace OVR::CAPI::GL nuclear@0: nuclear@0: nuclear@0: #endif // OVR_CAPI_GL_HSWDisplay_h nuclear@0: