From e490c3c7f7bb5461cfa78a214827aa534fb43a3e Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Sat, 21 Mar 2015 21:19:34 +0100 Subject: Bump OculusVR RIFT SDK to 0.4.4 --- LibOVR/Src/CAPI/GL/CAPI_GL_DistortionRenderer.h | 92 +++++++++---------------- 1 file changed, 32 insertions(+), 60 deletions(-) (limited to 'LibOVR/Src/CAPI/GL/CAPI_GL_DistortionRenderer.h') diff --git a/LibOVR/Src/CAPI/GL/CAPI_GL_DistortionRenderer.h b/LibOVR/Src/CAPI/GL/CAPI_GL_DistortionRenderer.h index 60f1a9f..f48e42d 100644 --- a/LibOVR/Src/CAPI/GL/CAPI_GL_DistortionRenderer.h +++ b/LibOVR/Src/CAPI/GL/CAPI_GL_DistortionRenderer.h @@ -5,12 +5,23 @@ Content : Distortion renderer header for GL Created : November 11, 2013 Authors : David Borel, Lee Cooper -Copyright : Copyright 2013 Oculus VR, Inc. All Rights reserved. +Copyright : Copyright 2014 Oculus VR, LLC All Rights reserved. -Use of this software is subject to the terms of the Oculus Inc license -agreement provided at the time of installation or download, or which +Licensed under the Oculus VR Rift SDK License Version 3.2 (the "License"); +you may not use the Oculus VR Rift SDK except in compliance with the License, +which is provided at the time of installation or download, or which otherwise accompanies this software in either electronic or hard copy form. +You may obtain a copy of the License at + +http://www.oculusvr.com/licenses/LICENSE-3.2 + +Unless required by applicable law or agreed to in writing, the Oculus VR SDK +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. + ************************************************************************************/ #ifndef OVR_CAPI_GL_DistortionRenderer_h @@ -33,7 +44,7 @@ public: DistortionRenderer(ovrHmd hmd, FrameTimeManager& timeManager, const HMDRenderState& renderState); - ~DistortionRenderer(); + virtual ~DistortionRenderer(); // Creation function for the device. @@ -44,12 +55,11 @@ public: // ***** Public DistortionRenderer interface - virtual bool Initialize(const ovrRenderAPIConfig* apiConfig, - unsigned distortionCaps); + virtual bool Initialize(const ovrRenderAPIConfig* apiConfig) OVR_OVERRIDE; - virtual void SubmitEye(int eyeId, ovrTexture* eyeTexture); + virtual void SubmitEye(int eyeId, const ovrTexture* eyeTexture); - virtual void EndFrame(bool swapBuffers, unsigned char* latencyTesterDrawColor, unsigned char* latencyTester2DrawColor); + virtual void EndFrame(bool swapBuffers); void WaitUntilGpuIdle(); @@ -58,57 +68,11 @@ public: double FlushGpuAndWaitTillTime(double absTime); protected: - - - class GraphicsState : public CAPI::DistortionRenderer::GraphicsState - { - public: - GraphicsState(); - virtual void Save(); - virtual void Restore(); - - protected: - void ApplyBool(GLenum Name, GLint Value); - - public: - GLint GlMajorVersion; - GLint GlMinorVersion; - bool SupportsVao; - - GLint Viewport[4]; - GLfloat ClearColor[4]; - GLint DepthTest; - GLint CullFace; - GLint Program; - GLint ActiveTexture; - GLint TextureBinding; - GLint VertexArray; - GLint FrameBufferBinding; - - GLint Blend; - GLint ColorWritemask[4]; - GLint Dither; - GLint Fog; - GLint Lighting; - GLint RasterizerDiscard; - GLint RenderMode; - GLint SampleMask; - GLint ScissorTest; - GLfloat ZoomX; - GLfloat ZoomY; - }; - - // TBD: Should we be using oe from RState instead? - unsigned DistortionCaps; struct FOR_EACH_EYE { - FOR_EACH_EYE() : TextureSize(0), RenderViewport(Sizei(0)) { } + FOR_EACH_EYE() : numVerts(0), numIndices(0), texture(0), /*UVScaleOffset[],*/ TextureSize(0, 0), RenderViewport(0, 0, 0, 0) { } -#if 0 - IDirect3DVertexBuffer9 * dxVerts; - IDirect3DIndexBuffer9 * dxIndices; -#endif int numVerts; int numIndices; @@ -119,10 +83,15 @@ protected: Recti RenderViewport; } eachEye[2]; + Ptr pOverdriveTextures[NumOverdriveTextures]; + Ptr OverdriveBackBufferTexture; + // GL context and utility variables. - RenderParams RParams; + RenderParams RParams; + Context distortionContext; // We are currently using this private OpenGL context instead of using the CAPI SaveGraphicsState/RestoreGraphicsState mechanism. To consider: Move this Context into SaveGraphicsState/RestoreGraphicState so there's consistency between DirectX and OpenGL. // Helpers + void initOverdrive(); void initBuffersAndShaders(); void initShaders(); void initFullscreenQuad(); @@ -140,6 +109,8 @@ protected: void renderLatencyQuad(unsigned char* latencyTesterDrawColor); void renderLatencyPixel(unsigned char* latencyTesterPixelColor); + void renderEndFrame(); + Ptr pEyeTextures[2]; Ptr DistortionMeshVBs[2]; // one per-eye @@ -148,6 +119,8 @@ protected: Ptr DistortionShader; + bool RotateCCW90; + struct StandardUniformData { Matrix4f Proj; @@ -157,10 +130,9 @@ protected: GLuint LatencyVAO; Ptr LatencyTesterQuadVB; Ptr SimpleQuadShader; + Ptr SimpleQuadGammaShader; - Ptr CurRenderTarget; - Array > DepthBuffers; - GLuint CurrentFbo; + GLuint OverdriveFbo; GLint SavedViewport[4]; GLfloat SavedClearColor[4]; @@ -175,4 +147,4 @@ protected: }}} // OVR::CAPI::GL -#endif // OVR_CAPI_GL_DistortionRenderer_h \ No newline at end of file +#endif // OVR_CAPI_GL_DistortionRenderer_h -- cgit v1.2.3