also close window on quit event
This commit is contained in:
parent
b32f7eeafc
commit
489a758c3c
1 changed files with 2 additions and 0 deletions
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue