From b079277d51c9d0ec8b6f9e64dc8901ef1bf6aaa6 Mon Sep 17 00:00:00 2001 From: erwincoumans Date: Tue, 19 Sep 2017 21:40:17 -0700 Subject: [PATCH] minor fixes in GLFWOpenGLWindow --- examples/OpenGLWindow/GLFWOpenGLWindow.cpp | 3 +-- examples/StandaloneMain/hellovr_opengl_main.cpp | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/examples/OpenGLWindow/GLFWOpenGLWindow.cpp b/examples/OpenGLWindow/GLFWOpenGLWindow.cpp index 36398b327..1bb3d0b25 100644 --- a/examples/OpenGLWindow/GLFWOpenGLWindow.cpp +++ b/examples/OpenGLWindow/GLFWOpenGLWindow.cpp @@ -350,15 +350,14 @@ void GLFWOpenGLWindow::startRendering() { if (m_data->m_glfwWindow) { - glfwSwapBuffers(m_data->m_glfwWindow); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT); - } } void GLFWOpenGLWindow::endRendering() { glfwPollEvents(); + glfwSwapBuffers(m_data->m_glfwWindow); } bool GLFWOpenGLWindow::isModifierKeyPressed(int key) diff --git a/examples/StandaloneMain/hellovr_opengl_main.cpp b/examples/StandaloneMain/hellovr_opengl_main.cpp index 90831dc8b..ad81cad3c 100644 --- a/examples/StandaloneMain/hellovr_opengl_main.cpp +++ b/examples/StandaloneMain/hellovr_opengl_main.cpp @@ -1007,7 +1007,7 @@ void CMainApplication::RenderFrame() // We want to make sure the glFinish waits for the entire present to complete, not just the submission // of the command. So, we do a clear here right here so the glFinish will wait fully for the swap. glClearColor( 0, 0, 0, 1 ); - glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT ); + //glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT ); } // Flush and wait for swap. @@ -1912,7 +1912,7 @@ void CMainApplication::RenderScene( vr::Hmd_Eye nEye ) { B3_PROFILE("RenderScene"); - glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); + //glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glEnable(GL_DEPTH_TEST); if( m_bShowCubes )