I was under the impression that there was a motion to deprecate engine support for going fullscreen, and promote the usage of the browser Fullscreen API directly:
playcanvas:master
← playcanvas:remove-fullscreen
opened 06:32PM - 24 Jun 19 UTC
This PR removes fullscreen support from the Engine.
Justification:
1. We … have to define a polyfill for the fullscreen API, plus the code for the fullscreen related functions themselves which the vast majority of developers don't use. With an every increasing emphasis on mobile (Safari has never supported it), the engine shouldn't try to abstract this away.
2. Our usage of the fullscreen API is not up to date. We pass Element.ALLOW_KEYBOARD_INPUT to requestFullscreen and that hasn't worked in years.
3. The latest spec for the fullscreen API uses Promises to notify when the request has been satisfied. Supporting that too is just going to complicate the engine even more.
4. We should avoid add DOM related code to the engine where possible (complicates the NodeJS version).
5. Browsers are gonna keep enabling/changing/deprecating behaviour around fullscreen API over time. We shouldn't have to track this ourselves. It's an unnecessary pain.
I just ripped out the PlayCanvas fullscreen stuff from an old project and replaced it simply with:
```app.graphicsDevice.canvas.requestFullscreen();```
Easy. Yes, I know I probably should check for errors potentially generated by requestFullscreen, but for 99.9% of users, it's fine. No need to add all this to the engine. Just let the developer deal with it.
Side effects of this PR:
Functionality is still there BUT:
1. You'll get deprecation messages in debug if you try to call ```isFullscreen```, ```enableFullscreen``` or ```disableFullscreen```.
2. The shim is removed. So for browser that prefix the Fullscreen API, your app will now return call the supplied error function if you call ```enableFullscreen```.
I confirm I have signed the [Contributor License Agreement](https://docs.google.com/a/playcanvas.com/forms/d/1Ih69zQfJG-QDLIEpHr6CsaAs6fPORNOVnMv5nuo0cjk/viewform).
Let me know if I am wrong!