gg: add quit fn (#10223)

pull/10228/head
KJ Lawrence 2021-05-27 10:56:18 -04:00 committed by GitHub
parent 8828054e5b
commit 6cdc7646b8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 0 deletions

View File

@ -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)