Add scope acquire context to simplify MakeCurrent and DoneCurrent calls

This commit is contained in:
James Rowe
2019-11-09 13:10:17 -07:00
parent 4f19d380f5
commit db7a627a2e
3 changed files with 42 additions and 0 deletions
@@ -0,0 +1,17 @@
// Copyright 2019 yuzu Emulator Project
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.
#include "core/frontend/emu_window.h"
#include "core/frontend/scope_acquire_context.h"
namespace Frontend {
ScopeAcquireContext::ScopeAcquireContext(Frontend::GraphicsContext& context) : context{context} {
context.MakeCurrent();
}
ScopeAcquireContext::~ScopeAcquireContext() {
context.DoneCurrent();
}
} // namespace Frontend