add explicit render platform channel method

This commit is contained in:
Nick Fisher
2022-09-06 19:35:46 +10:00
parent 449c6ed9bd
commit 00284ae7e3
2 changed files with 12 additions and 1 deletions

View File

@@ -15,6 +15,7 @@ abstract class FilamentController {
Future createTextureViewer(int width, int height, { double devicePixelRatio = 1});
Future setFrameRate(int framerate);
Future setRendering(bool render);
Future render();
Future resize(int width, int height, { double devicePixelRatio = 1, double contentScaleFactor=1});
Future setBackgroundImage(String path);
@@ -111,6 +112,10 @@ class PolyvoxFilamentController extends FilamentController {
await _channel.invokeMethod("setRendering", render);
}
Future render() async {
await _channel.invokeMethod("render");
}
Future setFrameRate(int framerate) async {
await _channel.invokeMethod("setFrameInterval", 1/ framerate);
}
@@ -241,6 +246,7 @@ class PolyvoxFilamentController extends FilamentController {
}
Future removeAsset(FilamentAsset asset) async {
print("Removing asset : $asset");
await _channel.invokeMethod("removeAsset", asset);
}