diff --git a/hyper.h b/hyper.h index 70f79a7f..b076aaac 100644 --- a/hyper.h +++ b/hyper.h @@ -792,6 +792,16 @@ template V callhandlers(V zero, const hookset& return h.callhandlers(zero, static_cast(args)...); } +void popScreen(); + +template void hook_in_subscreen(hookset& m, int prio, U&& hook) { + int v = m.add(prio, static_cast(hook)); + pushScreen([&m, v] { + delHook(m, v); + popScreen(); + }); + } + string XLAT(string); #define GLERR(call) glError(call, __FILE__, __LINE__)