X-Git-Url: http://nitlanguage.org diff --git a/lib/gamnit/gamnit.nit b/lib/gamnit/gamnit.nit index 63a5923..fccf2ae 100644 --- a/lib/gamnit/gamnit.nit +++ b/lib/gamnit/gamnit.nit @@ -59,8 +59,6 @@ redef class App redef fun run do - if "NIT_TESTING".environ == "true" then exit 0 - # TODO manage exit condition loop frame_full end @@ -70,12 +68,18 @@ redef class App # The implementation varies per platform. private fun feed_events do end - # Main method to receive `InputEvent` produced by the system + # Hook to receive and respond to `event` triggered by the user or system # # Returns whether or not the event is used or intercepted. # If `true`, the event will not be processed further by the system. # Returns `false` to intercepts events like the back key on mobile devices. # - # This method should be refined by client modules to react to user inputs. + # The instances passed as `event` may be freed (or overwritten), + # right after this method returns. They should not be preserved. fun accept_event(event: InputEvent): Bool do return false + + # The window has been resized by the user or system + # + # The framework handles resizing the viewport automatically. + fun on_resize(display: GamnitDisplay) do end end