Package 

Class FilamentHelper

    • Method Summary

      Modifier and Type Method Description
      static void synchronizePendingFrames(Engine engine) Wait for all pending frames to be processed before returning.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • synchronizePendingFrames

         static void synchronizePendingFrames(Engine engine)

        Wait for all pending frames to be processed before returning. This is to avoid a racebetween the surface being resized before pending frames are rendered into it.

        For android.view.TextureView this must be called before the texture's size isreconfigured, which unfortunately is done by the Android framework before UiHelper listeners are invoked. Therefore synchronizePendingFramescannot be called from onSurfaceTextureSizeChanged; insteada subclass of android.view.TextureView must be used in order to call it from onSizeChanged:

        public class MyTextureView extends TextureView {
            private Engine engine;
            protected void onSizeChanged(int w, int h, int oldw, int oldh) {
                FilamentHelper.synchronizePendingFrames(engine);
                super.onSizeChanged(w, h, oldw, oldh);
            }
        }
        
        Otherwise, this is typically called from onResized, surfaceChanged.
        Parameters:
        engine - Filament engine to synchronize