-
public class FilamentHelper
-
-
Method Summary
Modifier and Type Method Description static voidsynchronizePendingFrames(Engine engine)Wait for all pending frames to be processed before returning. -
-
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:
Otherwise, this is typically called from onResized, surfaceChanged.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); } }- Parameters:
engine- Filament engine to synchronize
-
-
-
-