feat: init repo
This commit is contained in:
commit
b2bd5910e7
87 changed files with 4335 additions and 0 deletions
28
lib/texture_rgba_renderer.dart
Normal file
28
lib/texture_rgba_renderer.dart
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
import 'dart:typed_data';
|
||||
|
||||
import 'texture_rgba_renderer_platform_interface.dart';
|
||||
|
||||
class TextureRgbaRenderer {
|
||||
/// Create a texture with unique [key].
|
||||
///
|
||||
/// @return a texture id which can be used with
|
||||
/// ```dart
|
||||
/// Texture(textureId: textureId)
|
||||
/// ```
|
||||
Future<int> createTexture(int key) {
|
||||
return TextureRgbaRendererPlatform.instance.createTexture(key);
|
||||
}
|
||||
|
||||
/// Close a texture with unique identifier [key].
|
||||
///
|
||||
/// @return a boolean to indicate whether the operation is sucessfully executed.
|
||||
Future<bool> closeTexture(int key) {
|
||||
return TextureRgbaRendererPlatform.instance.closeTexture(key);
|
||||
}
|
||||
|
||||
/// Provide the rgba data to the texture.
|
||||
Future<bool> onRgba(int key, Uint8List data, int height, int width) {
|
||||
return TextureRgbaRendererPlatform.instance
|
||||
.onRgba(key, data, height, width);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue