From cdc0673db7f261b2ae7c40e957fc42eda13b773d Mon Sep 17 00:00:00 2001 From: cuu Date: Fri, 10 Aug 2018 22:13:23 +0800 Subject: [PATCH] test.go --- test.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/test.go b/test.go index a8446e8..cae2eb4 100644 --- a/test.go +++ b/test.go @@ -18,6 +18,9 @@ import ( "github.com/cuu/gogame/time" ) +const ( + RUNEVT=1 +) func run() int { width := 320 @@ -82,7 +85,8 @@ func run() int { display.Flip() - + event.AddCustomEvent(RUNEVT) + running := true for running { ev := event.Wait() @@ -106,7 +110,7 @@ func run() int { time.Delay(1000) } if ev.Data["Key"] == "P" { - event.Post(event.RUNEVT,"GODEBUG=cgocheck=0 sucks") // just id and string, simplify the stuff + event.Post(RUNEVT,"GODEBUG=cgocheck=0 sucks") // just id and string, simplify the stuff } } }