diff --git a/vlib/gg/gg.v b/vlib/gg/gg.v index 127789e36b..c1201223f0 100644 --- a/vlib/gg/gg.v +++ b/vlib/gg/gg.v @@ -359,6 +359,11 @@ pub fn (gg &Context) run() { sapp.run(&gg.window) } +// quit closes the context window and exits the event loop for it +pub fn (ctx &Context) quit() { + sapp.request_quit() // does not require ctx right now, but sokol multi-window might in the future +} + pub fn (mut ctx Context) set_bg_color(c gx.Color) { ctx.clear_pass = gfx.create_clear_pass(f32(c.r) / 255.0, f32(c.g) / 255.0, f32(c.b) / 255.0, f32(c.a) / 255.0)