also close window on quit event

This commit is contained in:
Thomas Friedel 2018-04-14 11:21:37 +02:00
parent b32f7eeafc
commit 489a758c3c

View file

@ -200,6 +200,8 @@ func (wnd *Window) MainLoop(run func()) {
if e.Event == sdl.WINDOWEVENT_CLOSE { if e.Event == sdl.WINDOWEVENT_CLOSE {
wnd.close = true wnd.close = true
} }
case *sdl.QuitEvent:
wnd.close = true
case *sdl.KeyDownEvent: case *sdl.KeyDownEvent:
if e.Keysym.Scancode == sdl.SCANCODE_ESCAPE { if e.Keysym.Scancode == sdl.SCANCODE_ESCAPE {
wnd.close = true wnd.close = true