obs/gs/helper: Throw exception if we aren't in a context

This commit is contained in:
Michael Fabian 'Xaymar' Dirks 2020-07-27 02:17:55 +02:00
parent c1abe07b0f
commit 07034c0e6e
1 changed files with 2 additions and 0 deletions

View File

@ -28,6 +28,8 @@ namespace gs {
inline context()
{
obs_enter_graphics();
if (gs_get_context() == nullptr)
throw std::runtime_error("Failed to enter graphics context.");
}
~context()
{