Material now implements NativeHandle
This commit is contained in:
@@ -3,7 +3,7 @@ import 'package:thermion_dart/src/filament/src/implementation/ffi_filament_app.d
|
|||||||
import 'package:thermion_dart/src/filament/src/implementation/ffi_texture.dart';
|
import 'package:thermion_dart/src/filament/src/implementation/ffi_texture.dart';
|
||||||
import 'package:thermion_dart/thermion_dart.dart';
|
import 'package:thermion_dart/thermion_dart.dart';
|
||||||
|
|
||||||
class FFIMaterial extends Material {
|
class FFIMaterial extends Material<Pointer<TMaterial>> {
|
||||||
final FFIFilamentApp app;
|
final FFIFilamentApp app;
|
||||||
final Pointer<TMaterial> pointer;
|
final Pointer<TMaterial> pointer;
|
||||||
|
|
||||||
@@ -28,6 +28,11 @@ class FFIMaterial extends Material {
|
|||||||
return Material_hasParameter(
|
return Material_hasParameter(
|
||||||
pointer, propertyName.toNativeUtf8().cast<Char>());
|
pointer, propertyName.toNativeUtf8().cast<Char>());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Pointer<TMaterial> getNativeHandle() {
|
||||||
|
return pointer;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class FFIMaterialInstance extends MaterialInstance<Pointer<TMaterialInstance>> {
|
class FFIMaterialInstance extends MaterialInstance<Pointer<TMaterialInstance>> {
|
||||||
|
|||||||
@@ -93,7 +93,7 @@ enum TransparencyMode {
|
|||||||
TWO_PASSES_TWO_SIDES
|
TWO_PASSES_TWO_SIDES
|
||||||
}
|
}
|
||||||
|
|
||||||
abstract class Material {
|
abstract class Material<T> extends NativeHandle<T> {
|
||||||
Future<MaterialInstance> createInstance();
|
Future<MaterialInstance> createInstance();
|
||||||
Future<bool> hasParameter(String propertyName);
|
Future<bool> hasParameter(String propertyName);
|
||||||
Future destroy();
|
Future destroy();
|
||||||
|
|||||||
Reference in New Issue
Block a user