Since the error message mentions CtxRef::begin_frame(), it seems like your code is supposed to use ctx.begin_frame(…) at some point. Either that’s missing, or if you have it, you aren’t showing us the complete situation here. The documentation of CtxRef has an example of how it might be used.