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

gg: use gg types for Events instead of sapp

This commit is contained in:
Alexander Medvednikov
2021-02-17 06:44:01 +01:00
parent 3341c17202
commit d4a05bebde
9 changed files with 247 additions and 74 deletions

View File

@ -1,7 +1,6 @@
module main
import gg
import sokol.sapp
import gx
import os
import time
@ -266,13 +265,13 @@ fn (app &App) draw() {
app.display()
}
fn on_event(e &sapp.Event, mut app App) {
fn on_event(e &gg.Event, mut app App) {
if e.typ == .key_down {
app.key_down(e.key_code)
}
}
fn (mut app App) key_down(key sapp.KeyCode) {
fn (mut app App) key_down(key gg.KeyCode) {
// global keys
match key {
.escape {