fixed flicker in native builds

pull/3471/head
kallaballa 2 years ago
parent 1464bc6a8b
commit 1cb9ba7281
  1. 1
      modules/v4d/src/detail/framebuffercontext.cpp
  2. 3
      modules/v4d/src/detail/nanoguicontext.cpp
  3. 1
      modules/v4d/src/v4d.cpp

@ -693,6 +693,7 @@ void FrameBufferContext::begin(GLenum framebufferTarget) {
}
void FrameBufferContext::end() {
this->makeCurrent();
GL_CHECK(glFlush());
}

@ -71,6 +71,7 @@ void NanoguiContext::render(bool print, bool graphical) {
{
#ifndef __EMSCRIPTEN__
mainFbContext_.makeCurrent();
GL_CHECK(glFinish());
GL_CHECK(glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0));
GL_CHECK(glViewport(0, 0, mainFbContext_.getWindowSize().width, mainFbContext_.getWindowSize().height));
glClear(GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
@ -109,6 +110,8 @@ void NanoguiContext::render(bool print, bool graphical) {
{
#ifdef __EMSCRIPTEN__
FrameBufferContext::GLScope glScope(fbCtx(), GL_FRAMEBUFFER);
#else
GL_CHECK(glFinish());
#endif
screen().draw_widgets();
}

@ -548,6 +548,7 @@ bool V4D::display() {
nguiCtx().render(printFPS_, showFPS_);
#endif
fbCtx().makeCurrent();
GL_CHECK(glFinish());
#ifndef __EMSCRIPTEN__
glfwSwapBuffers(fbCtx().getGLFWWindow());
#else

Loading…
Cancel
Save