# FlutterTextureRegistry

Objective-C

    @protocol FlutterTextureRegistry <NSObject>

Swift

    protocol FlutterTextureRegistry : NSObjectProtocol

A collection of registered `FlutterTexture`‘s.

- `-registerTexture:`

  Registers a `FlutterTexture` for usage in Flutter and returns an id that can be used to reference that texture when calling into Flutter with channels. Textures must be registered on the platform thread. On success returns the pointer to the registered texture, else returns 0.

  #### Declaration

  Objective-C

      - (int64_t)registerTexture:(nonnull NSObject<FlutterTexture> *)texture;

  Swift

      func register(_ texture: FlutterTexture) -> Int64

- `-textureFrameAvailable:`

  Notifies Flutter that the content of the previously registered texture has been updated.

  This will trigger a call to `-[FlutterTexture copyPixelBuffer]` on the raster thread.

  #### Declaration

  Objective-C

      - (void)textureFrameAvailable:(int64_t)textureId;

  Swift

      func textureFrameAvailable(_ textureId: Int64)

- `-unregisterTexture:`

  Unregisters a `FlutterTexture` that has previously regeistered with `registerTexture:`. Textures must be unregistered on the platform thread.

  #### Declaration

  Objective-C

      - (void)unregisterTexture:(int64_t)textureId;

  Swift

      func unregisterTexture(_ textureId: Int64)

  #### Parameters

  `textureId` | The result that was previously returned from `registerTexture:`.

© 2023 Flutter. All rights reserved. (Last updated: 2023-06-01)

Generated by jazzy ♪♫ v0.14.3, a Realm project.