Add a way to query and set Display information

Renderer can now be given a DisplayInfo that contains some
important information about the current display. This will be used
for frame-pacing and dynamic-resolution.

This is most relevant on Android, where we can accurately query these
parameters. Added support for that in our samples.


This also sets the minSDK to 19 (including gltf viewer's), since this is
the version we support. We were cheating before by under-reporting our
minSdk.
This commit is contained in:
Pixelflinger
2020-04-06 16:55:24 -07:00
committed by Mathias Agopian
parent 526898e7d6
commit b2dd6683be
18 changed files with 167 additions and 15 deletions
@@ -25,6 +25,7 @@ import android.view.SurfaceView
import android.view.animation.LinearInterpolator
import com.google.android.filament.*
import com.google.android.filament.android.DisplayHelper
import com.google.android.filament.android.UiHelper
import com.google.android.filament.filamat.MaterialBuilder
@@ -320,6 +321,7 @@ class MainActivity : Activity() {
override fun onNativeWindowChanged(surface: Surface) {
swapChain?.let { engine.destroySwapChain(it) }
swapChain = engine.createSwapChain(surface)
renderer.setDisplayInfo(DisplayHelper.getDisplayInfo(surfaceView.display, Renderer.DisplayInfo()))
}
override fun onDetachedFromSurface() {