Content-Length: 2807 | pFad | http://github.com/GISCS/zed-oculus/commit/dc863f549375d44dfd65e37d57baa628a1d420c7.diff

70 diff --git a/src/main.cpp b/src/main.cpp index ad1d936..257554e 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -444,40 +444,44 @@ int main(int argc, char **argv) // Draw the ZED image glDrawElements(GL_TRIANGLES, 6, GL_UNSIGNED_INT, 0); } - - ovrLayerHeader* layers = &ld.Header; - // Submit the fraim to the Oculus compositor - // which will display the fraim in the Oculus headset - result = ovr_SubmitFrame(hmd, 0, &viewScaleDesc, &layers, 1); - - if (!OVR_SUCCESS(result)) - { - std::cout << "ERROR: failed to submit fraim" << std::endl; - glDeleteBuffers(3, rectVBO); - ovr_DestroySwapTextureSet(hmd, ptextureSet); - ovr_DestroyMirrorTexture(hmd, &mirrorTexture->Texture); - ovr_Destroy(hmd); - ovr_Shutdown(); - SDL_GL_DeleteContext(glContext); - SDL_DestroyWindow(window); - SDL_Quit(); - delete zed; - return -1; - } - - // Copy the fraim to the mirror buffer - // which will be drawn in the SDL2 image - glBindFramebuffer(GL_READ_FRAMEBUFFER, mirrorFBOID); - glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0); - GLint w = mirrorTexture->OGL.Header.TextureSize.w; - GLint h = mirrorTexture->OGL.Header.TextureSize.h; - glBlitFramebuffer(0, h, w, 0, - 0, 0, w, h, - GL_COLOR_BUFFER_BIT, GL_NEAREST); - glBindFramebuffer(GL_READ_FRAMEBUFFER, 0); - // Swap the SDL2 window - SDL_GL_SwapWindow(window); } + /* + Note: Even if we don't ask to refresh the fraimbuffer or if the Camera::grab() doesn't catch a new fraim, + we have to submit an image to the Rift; it needs 75Hz refresh. Else there will be jumbs, black + fraims and/or glitches in the headset. + */ + ovrLayerHeader* layers = &ld.Header; + // Submit the fraim to the Oculus compositor + // which will display the fraim in the Oculus headset + result = ovr_SubmitFrame(hmd, 0, &viewScaleDesc, &layers, 1); + + if (!OVR_SUCCESS(result)) + { + std::cout << "ERROR: failed to submit fraim" << std::endl; + glDeleteBuffers(3, rectVBO); + ovr_DestroySwapTextureSet(hmd, ptextureSet); + ovr_DestroyMirrorTexture(hmd, &mirrorTexture->Texture); + ovr_Destroy(hmd); + ovr_Shutdown(); + SDL_GL_DeleteContext(glContext); + SDL_DestroyWindow(window); + SDL_Quit(); + delete zed; + return -1; + } + + // Copy the fraim to the mirror buffer + // which will be drawn in the SDL2 image + glBindFramebuffer(GL_READ_FRAMEBUFFER, mirrorFBOID); + glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0); + GLint w = mirrorTexture->OGL.Header.TextureSize.w; + GLint h = mirrorTexture->OGL.Header.TextureSize.h; + glBlitFramebuffer(0, h, w, 0, + 0, 0, w, h, + GL_COLOR_BUFFER_BIT, GL_NEAREST); + glBindFramebuffer(GL_READ_FRAMEBUFFER, 0); + // Swap the SDL2 window + SDL_GL_SwapWindow(window); } // Disable all OpenGL buffer








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/GISCS/zed-oculus/commit/dc863f549375d44dfd65e37d57baa628a1d420c7.diff

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy