Share via


OpenGLView.OnDisplay Property

Definition

Overridden to create a custom rendering loop.

public Action<Xamarin.Forms.Rectangle> OnDisplay { get; set; }
member this.OnDisplay : Action<Xamarin.Forms.Rectangle> with get, set

Property Value

System.Action<Rectangle>

Remarks

When overridden, creates a custom renderer:

var view = new OpenGLView { HasRenderLoop = true };
view.OnDisplay = r => {

    GL.ClearColor (red, green, blue, 1.0f);
    GL.Clear ((ClearBufferMask.ColorBufferBit | ClearBufferMask.DepthBufferBit));

    red += 0.01f;
    if (red >= 1.0f)
        red -= 1.0f;
    green += 0.02f;
    if (green >= 1.0f)
        green -= 1.0f;
    blue += 0.03f;
    if (blue >= 1.0f)
        blue -= 1.0f;
};

Applies to