Skip to main content

OpenGlCompositionInterop Class

Definition​

Namespace:Avalonia.OpenGL
Assembly:Avalonia.OpenGL
Package:Avalonia

Provides OpenGL interop facilities for the composition engine.

public class OpenGlCompositionInterop

Inheritance: object -> OpenGlCompositionInterop

Methods​

NameDescription
TryCreateCompatibleGlContextAsyncAttempts to create an OpenGL context that is suitable for interop with the compositor's GPU context. Must be called on the thread the compositor belongs to.

TryCreateCompatibleGlContextAsync Method​

Attempts to create an OpenGL context that is suitable for interop with the compositor's GPU context. Must be called on the thread the compositor belongs to.

public System.Threading.Tasks.ValueTask<Avalonia.OpenGL.ICompositionGlContext> TryCreateCompatibleGlContextAsync(Avalonia.Rendering.Composition.Compositor compositor, Avalonia.OpenGL.CompositionGlContextOptions options)

Parameters​

compositor Avalonia.Rendering.Composition.Compositor

options Avalonia.OpenGL.CompositionGlContextOptions

Returns​

System.Threading.Tasks.ValueTask<Avalonia.OpenGL.ICompositionGlContext>

The created context, or null when the current platform or compositor configuration doesn't support OpenGL interop. The concrete reason is logged to the "OpenGL" log area.