Merge: gamnit: intro dynamic resolution support
authorJean Privat <jean@pryen.org>
Tue, 11 Apr 2017 12:30:24 +0000 (08:30 -0400)
committerJean Privat <jean@pryen.org>
Tue, 11 Apr 2017 12:30:24 +0000 (08:30 -0400)
The dynamic resolution can change while the game is running to reduce the load on the GPU when more performance is needed. So an action scene may display tons of explosions and maintain a good framerate by reducing the number of pixels on screen, and a calm scene may gain back the full resolution to better show details.

At this point, the dynamic resolution must be set manually by the user (using something like a video quality slider) or by some heuristic. Future improvement could autodetect skipped frame and set the resolution accordingly.

While the current set of gamnit games rarely overload a GPU, there is many scenarios where a dynamic resolution can be useful: mobile device with a high-resolution display and a limited battery, 4K Android TVs and a VR headset that must maintain 90 FPS.

In Asteronits, the keys `, and .` change the dynamic resolution. Here are a few screenshots of the results.

At 1.0, the native resolution:
![screenshot from 2017-04-06 13 14 08](https://cloud.githubusercontent.com/assets/208057/24768761/cfd3bd6a-1ad1-11e7-993b-5f2e76034a31.png)

At 0.25:
![screenshot from 2017-04-06 13 14 25](https://cloud.githubusercontent.com/assets/208057/24768762/d2292b36-1ad1-11e7-84b2-7b3ab602cd67.png)

At 0.03: (I wouldn't recommend using this value by default)
![screenshot from 2017-04-06 13 14 34](https://cloud.githubusercontent.com/assets/208057/24768771/df0ac0d0-1ad1-11e7-8493-7efb2e7c30fc.png)

Pull-Request: #2408


Trivial merge