Skip to content

Commit fcf9599

Browse files
committed
[render] fix crash when double click viewer with imgui drawer
1 parent 59f2713 commit fcf9599

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

vclib/render/include/vclib/bgfx/canvas.h

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -179,11 +179,6 @@ class CanvasBGFX
179179
*/
180180
void onPaint()
181181
{
182-
bgfx::setViewFrameBuffer(mViewId, mFbh);
183-
bgfx::touch(mViewId);
184-
// ask the derived frame to draw all the drawer objects:
185-
DerivedRenderApp::CNV::draw(derived());
186-
187182
const bool newReadRequested =
188183
(mReadRequest != std::nullopt && !mReadRequest->isSubmitted());
189184

@@ -198,6 +193,12 @@ class CanvasBGFX
198193
}
199194
}
200195
else {
196+
bgfx::setViewFrameBuffer(mViewId, mFbh);
197+
bgfx::touch(mViewId);
198+
199+
// ask the derived frame to draw all the drawer objects:
200+
DerivedRenderApp::CNV::draw(derived());
201+
201202
mCurrFrame = bgfx::frame();
202203

203204
// this is required only when using Qt in macOS

0 commit comments

Comments
 (0)