Add scope acquire context to simplify MakeCurrent and DoneCurrent calls

This commit is contained in:
James Rowe
2019-09-16 20:34:57 -06:00
parent 4f19d380f5
commit db7a627a2e
3 changed files with 42 additions and 0 deletions

View File

@ -0,0 +1,23 @@
// Copyright 2019 yuzu Emulator Project
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.
#pragma once
#include "common/common_types.h"
namespace Frontend {
class GraphicsContext;
/// Helper class to acquire/release window context within a given scope
class ScopeAcquireContext : NonCopyable {
public:
explicit ScopeAcquireContext(Frontend::GraphicsContext& context);
~ScopeAcquireContext();
private:
Frontend::GraphicsContext& context;
};
} // namespace Frontend