mirror of
https://github.com/Xaymar/obs-StreamFX
synced 2024-11-11 06:15:05 +00:00
obs/gs/helper: Throw exception if we aren't in a context
This commit is contained in:
parent
c1abe07b0f
commit
07034c0e6e
1 changed files with 2 additions and 0 deletions
|
@ -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()
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue