diff options
Diffstat (limited to 'unicorn/FakeUnicorn.go')
-rw-r--r-- | unicorn/FakeUnicorn.go | 16 |
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 + } + } + } +} |