ICompositionGlTextureLease Interface
Definition
An active drawing session on an Avalonia.OpenGL.ICompositionGlTexture. The lease is ended either by Avalonia.OpenGL.ICompositionGlTextureLease.PresentAsync or by IDisposable.Dispose, the latter discards the frame. Disposing after Avalonia.OpenGL.ICompositionGlTextureLease.PresentAsync is a no-op.
public interface ICompositionGlTextureLease
Methods
| Name | Description |
|---|---|
| PresentAsync | Ends the lease and asynchronously presents the texture to the associated Avalonia.Rendering.Composition.CompositionDrawingSurface. This will happen when the next composition commit is processed by the render thread. The texture must be unbound from user framebuffers before calling this method. The returned task completes when the texture can be drawn to again, NOT when the frame becomes visible on the screen. You should NOT await the returned task while keeping hold of a Avalonia.OpenGL.IGlContext.MakeCurrent disposable. |
PresentAsync Method
Ends the lease and asynchronously presents the texture to the associated Avalonia.Rendering.Composition.CompositionDrawingSurface. This will happen when the next composition commit is processed by the render thread. The texture must be unbound from user framebuffers before calling this method. The returned task completes when the texture can be drawn to again, NOT when the frame becomes visible on the screen. You should NOT await the returned task while keeping hold of a Avalonia.OpenGL.IGlContext.MakeCurrent disposable.
public System.Threading.Tasks.Task PresentAsync()
Returns
System.Threading.Tasks.Task
Properties
| Name | Description |
|---|---|
| TextureInfo | Describes the OpenGL texture to draw into. Only valid until the lease ends; Avalonia.OpenGL.CompositionGlTextureInfo.TextureId is not guaranteed to be stable between leases. |
TextureInfo Property
Describes the OpenGL texture to draw into. Only valid until the lease ends; Avalonia.OpenGL.CompositionGlTextureInfo.TextureId is not guaranteed to be stable between leases.
public Avalonia.OpenGL.CompositionGlTextureInfo TextureInfo { get; set; }