How to get the context of a piston window prior to using window.draw_2d?

I have a situation where I need to access the context of a piston_window prior to entering the window rendering loop where I normally access it by doing:

window.draw_2d(&e, |_c, g, _device| {
                            clear([0.1, 0.2, 0.3, 1.0], g);

where _c is the context.
Is there a way to access the context prior to the loop?

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.