minor fixes in GLFWOpenGLWindow

This commit is contained in:
erwincoumans
2017-09-19 21:40:17 -07:00
parent cadce37141
commit b079277d51
2 changed files with 3 additions and 4 deletions

View File

@@ -350,15 +350,14 @@ void GLFWOpenGLWindow::startRendering()
{ {
if (m_data->m_glfwWindow) if (m_data->m_glfwWindow)
{ {
glfwSwapBuffers(m_data->m_glfwWindow);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
} }
} }
void GLFWOpenGLWindow::endRendering() void GLFWOpenGLWindow::endRendering()
{ {
glfwPollEvents(); glfwPollEvents();
glfwSwapBuffers(m_data->m_glfwWindow);
} }
bool GLFWOpenGLWindow::isModifierKeyPressed(int key) bool GLFWOpenGLWindow::isModifierKeyPressed(int key)

View File

@@ -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 // 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. // 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 ); 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. // Flush and wait for swap.
@@ -1912,7 +1912,7 @@ void CMainApplication::RenderScene( vr::Hmd_Eye nEye )
{ {
B3_PROFILE("RenderScene"); 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); glEnable(GL_DEPTH_TEST);
if( m_bShowCubes ) if( m_bShowCubes )