/** * Updates the session display geometry if a change was posted either by * {@link #onSurfaceChanged(int, int)} call or by {@link #onDisplayChanged(int)} system * callback. This function should be called explicitly before each call to * {@link Session#update()}. This function will also clear the 'pending update' * (viewportChanged) flag. * * @param session the {@link Session} object to update if display geometry changed. */ public void UpdateSessionIfNeeded(Google.AR.Core.Session session) { if (mViewportChanged) { int displayRotation = (int)mDisplay.Rotation; session.SetDisplayGeometry(displayRotation, mViewportWidth, mViewportHeight); mViewportChanged = false; } }
/// <summary> /// Updates the session display geometry if a change was posted either by /// {@link #onSurfaceChanged(int, int)} call or by {@link #onDisplayChanged(int)} system /// callback. This function should be called explicitly before each call to /// {@link Session#update()}. This function will also clear the 'pending update' /// (viewportChanged) flag. /// </summary> public void UpdateSessionIfNeeded(Google.AR.Core.Session session) { if (!this.viewportChanged) { return; } var displayRotation = (int)this.display.Rotation; session.SetDisplayGeometry(displayRotation, this.viewportWidth, this.viewportHeight); this.viewportChanged = false; }