aboutsummaryrefslogtreecommitdiff
path: root/unicorn/FakeUnicorn.go
diff options
context:
space:
mode:
authorMartin Ashby <martin@martin-laptop.lan>2018-05-21 10:16:53 +0100
committerMartin Ashby <martin@martin-laptop.lan>2018-05-21 10:16:53 +0100
commit042cfafc7dc2abac8f6ddb111a948aa1d9784811 (patch)
treee7116ef1bd99ca06f7918a8a6e8dbe46f215f4ce /unicorn/FakeUnicorn.go
parent34f1a11454fc38a77338569f466df879fd1792f7 (diff)
downloadunicornpaint-042cfafc7dc2abac8f6ddb111a948aa1d9784811.tar.gz
unicornpaint-042cfafc7dc2abac8f6ddb111a948aa1d9784811.tar.bz2
unicornpaint-042cfafc7dc2abac8f6ddb111a948aa1d9784811.tar.xz
unicornpaint-042cfafc7dc2abac8f6ddb111a948aa1d9784811.zip
Added mainloop
Diffstat (limited to 'unicorn/FakeUnicorn.go')
-rw-r--r--unicorn/FakeUnicorn.go16
1 files changed, 16 insertions, 0 deletions
diff --git a/unicorn/FakeUnicorn.go b/unicorn/FakeUnicorn.go
index 85833c9..eaec4f2 100644
--- a/unicorn/FakeUnicorn.go
+++ b/unicorn/FakeUnicorn.go
@@ -96,3 +96,19 @@ func (f *FakeUnicorn) Show() {
func (f *FakeUnicorn) Off() {
f.Close()
}
+
+// MainLoop ...
+// Handle UI events so OS doesn't think we're frozen
+func (f *FakeUnicorn) MainLoop() {
+ running := true
+ for running {
+ for event := sdl.PollEvent(); event != nil; event = sdl.PollEvent() {
+ switch event.(type) {
+ case *sdl.QuitEvent:
+ println("Quit")
+ running = false
+ break
+ }
+ }
+ }
+}