-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Open
Description
Prerequisite Checklist
- I searched for existing issues to prevent duplicates
- I searched for existing discussions on the forum to prevent duplicates
- I understand SFML's scope and believe the feature fits it
Describe your feature request here
Currently, Mobile events are weird. Especially for Android.
- onPause triggers a MouseLeft.
- onResume triggers a MouseEntered.
- Rotating the screen (an event different from handleResized, which is triggered when you pop up the Android UI) triggers a Resized.
- FocusGained triggers the creation of the surface.
- FocusLost triggers the destruction of the surface.
I think these events should be separated, or at least aliased in some way (and better documented, not just present in an example for the user to find).
The risk I see with recycling events like this (aside from the opacity of it all) is that it makes the code really not portable, in some ways.
Use Cases
Better handling of events to write portable code, which doesn't require ifdefs.
API Example
Proposals:
onPause -> AppBackground
onResume -> AppForeground
screen Rotation -> ScreenRotated
FocusGained -> CreateSurface (internal, no need to propagate it)
FocusLost -> DestroySurface (internal, no need to propagate it)