1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

gg: add quit fn (#10223)

This commit is contained in:
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

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)