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

View file

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