Commit Graph

2 Commits

Author SHA1 Message Date
Hajime Hoshi
49c3c30c79 ebiten: Add IsWindowBeingClosed / SetWindowClosingHandled / IsWindowClosingHandled
IsWindowBeingClosed reports whether the window is being closed by
the user.

SetWindowClosingHandled sets whether the window closing is handled
or not. If the state is true, the window is not closed immediately
by the user and the game can handle the closing state. In this case,
the Update function should return an error in order to end the game.

This change also adds examples/windowclosing.

Closes #1574
2021-06-14 02:29:11 +09:00
Hajime Hoshi
3c2d562967 internal/glfw: Bug fix: NewCallbackCDecl objects were leaked
Callbacks created by NewCallbackCDecl were never released and then
they are leaked, especially when the window size was changed by
SetWindowSize on Windows.

This change defines new callback ID types with uintptr, and reuse
the callbacks.

Closes #1672
2021-06-13 22:23:01 +09:00