OpenGLTexture class

A widget that contains the Texture widget.

The size of this widget is not related to the texture size. It grabs also the mouse events to pass to the shader.

First get the id calling OpenGLController().flutterOpenglPlugin.createSurface then feed this widget with id got:

'''dart SizedBox( width: 400, height: 300, child: FutureBuilder( /// The surface size identifies the real texture size and /// it is not related to the above SizedBox size future: OpenGLController().openglPlugin.createSurface(300, 200), builder: (_, snapshot) { if (snapshot.hasError || !snapshot.hasData) { return const SizedBox.shrink(); } /// When the texture id is retrieved, it will be possible /// to start the renderer, set a shader and display it.

  /// Start renderer thread
  OpenGLController().openglFFI.startThread();

  /// Set the fragment shader
  OpenGLController().openglFFI.setShaderToy(fShader);

  /// build the texture widget
  return OpenGLTexture(id: snapshot.data!);
},

), ) '''

Inheritance

Constructors

OpenGLTexture({Key? key, required int id})
const

Properties

hashCode int
The hash code for this object.
no setterinherited
id int
the texture id got by OpenGLController().flutterOpenglPlugin.createSurface
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

build(BuildContext context) Widget
Describes the part of the user interface represented by this widget.
override
createElement() StatelessElement
Creates a StatelessElement to manage this widget's location in the tree.
inherited
debugDescribeChildren() List<DiagnosticsNode>
Returns a list of DiagnosticsNode objects describing this node's children.
inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toDiagnosticsNode({String? name, DiagnosticsTreeStyle? style}) DiagnosticsNode
Returns a debug representation of the object that is used by debugging tools and by DiagnosticsNode.toStringDeep.
inherited
toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) String
A string representation of this object.
inherited
toStringDeep({String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) String
Returns a string representation of this node and its descendants.
inherited
toStringShallow({String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a one-line detailed description of the object.
inherited
toStringShort() String
A short, textual description of this widget.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited