Skip to content

Commit

Permalink
Fixed OpenGL error on Saving image or sequences.
Browse files Browse the repository at this point in the history
  • Loading branch information
ggarra13 committed Sep 10, 2023
1 parent e78d9aa commit e1bb0b5
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions mrv2/lib/mrvFl/mrvSaving.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ namespace fs = std::filesystem;
#include <tlCore/StringFormat.h>
#include <tlCore/Time.h>

#include <tlGL/Init.h>
#include <tlGL/Util.h>
#include <tlTimeline/GLRender.h>

Expand Down Expand Up @@ -224,6 +225,10 @@ namespace mrv
view->setHudActive(false);

math::Size2i offscreenBufferSize(renderSize.w, renderSize.h);

view->make_current();
gl::initGLAD();

auto buffer = gl::OffscreenBuffer::create(
offscreenBufferSize, offscreenBufferOptions);

Expand All @@ -249,6 +254,9 @@ namespace mrv
const auto& videoData =
timeline->getVideo(currentTime).get();

view->make_current();
gl::initGLAD();

// Render the video.
gl::OffscreenBufferBinding binding(buffer);
CHECK_GL;
Expand Down Expand Up @@ -519,6 +527,8 @@ namespace mrv
view->setHudActive(false);

math::Size2i offscreenBufferSize(renderSize.w, renderSize.h);
view->make_current();
gl::initGLAD();
auto buffer = gl::OffscreenBuffer::create(
offscreenBufferSize, offscreenBufferOptions);
CHECK_GL;
Expand Down

0 comments on commit e1bb0b5

Please sign in to comment.