fix iOS
This commit is contained in:
33
flutter_filament/macos/Classes/FlutterFilamentTexture.swift
Normal file
33
flutter_filament/macos/Classes/FlutterFilamentTexture.swift
Normal file
@@ -0,0 +1,33 @@
|
||||
import Foundation
|
||||
import GLKit
|
||||
import FlutterMacOS
|
||||
|
||||
public class FlutterFilamentTexture : NSObject, FlutterTexture {
|
||||
|
||||
var texture:DartFilamentTexture
|
||||
var flutterTextureId: Int64 = -1
|
||||
var registry: FlutterTextureRegistry
|
||||
|
||||
init(registry:FlutterTextureRegistry, texture:DartFilamentTexture) {
|
||||
self.texture = texture
|
||||
self.registry = registry
|
||||
super.init()
|
||||
|
||||
self.flutterTextureId = registry.register(self)
|
||||
|
||||
}
|
||||
|
||||
public func copyPixelBuffer() -> Unmanaged<CVPixelBuffer>? {
|
||||
return Unmanaged.passRetained(texture.pixelBuffer!);
|
||||
}
|
||||
|
||||
public func onTextureUnregistered(_ texture:FlutterTexture) {
|
||||
print("Texture unregistered")
|
||||
}
|
||||
|
||||
public func destroy() {
|
||||
self.registry.unregisterTexture(self.flutterTextureId)
|
||||
self.texture.destroyTexture()
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user