Table of Contents

Class AvaloniaGlContext

Namespace
Thunder.MonoGame.Avalonia.Platform
Assembly
MonoGame.Framework.dll

Broker that makes the current frame's GlInterface and framebuffer available to MonoGame's GraphicsDevice during OnOpenGlRender.

Lifetime: set at the top of OnOpenGlRender, cleared at the bottom. Accessing GlInterface outside that window throws.

public sealed class AvaloniaGlContext
Inheritance
AvaloniaGlContext
Inherited Members

Properties

Current

Gets the context active on this thread, or throws if none is set.

public static AvaloniaGlContext Current { get; }

Property Value

AvaloniaGlContext

Framebuffer

The framebuffer object Avalonia expects all rendering to target this frame. Pass this to gl.BindFramebuffer(GL_FRAMEBUFFER, Framebuffer) at the start of each render, otherwise MonoGame's output goes to framebuffer 0 (the default backbuffer) and never reaches Avalonia's compositor.

public int Framebuffer { get; }

Property Value

int

GlInterface

The Avalonia-managed GlInterface for this frame. Use this to issue raw GL calls (e.g. BindFramebuffer, GetIntegerv) that MonoGame does not expose. The interface is only valid within OnOpenGlRender; accessing it outside that scope throws from Current.

public GlInterface GlInterface { get; }

Property Value

GlInterface
latest ▼