Skip to content

Commit 139c4ce

Browse files
bakpaulfredroy
authored andcommitted
Small optim
1 parent 472fbc1 commit 139c4ce

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

SofaGLFW/src/SofaGLFW/SofaGLFWBaseGUI.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -487,6 +487,8 @@ std::size_t SofaGLFWBaseGUI::runLoop(std::size_t targetNbIterations)
487487
bool running = true;
488488
std::size_t currentNbIterations = 0;
489489
std::stringstream tmpStr;
490+
std::vector<uint8_t> pixels;
491+
490492
while (s_numberOfActiveWindows > 0 && running)
491493
{
492494
SIMULATION_LOOP_SCOPE
@@ -520,7 +522,6 @@ std::size_t SofaGLFWBaseGUI::runLoop(std::size_t targetNbIterations)
520522
// Read framebuffer
521523
if(this->groot->getAnimate() && this->m_bVideoRecording)
522524
{
523-
std::vector<uint8_t> pixels;
524525
const auto [width, height] = this->m_guiEngine->getFrameBufferPixels(pixels);
525526
m_videoRecorderFFMPEG.addFrame(pixels.data(), width, height);
526527
}

0 commit comments

Comments
 (0)