Partager via


OpenGLView.OnDisplay Propriété

Définition

Substituée pour créer une boucle de rendu personnalisée.

public:
 property Action<Microsoft::Maui::Graphics::Rect> ^ OnDisplay { Action<Microsoft::Maui::Graphics::Rect> ^ get(); void set(Action<Microsoft::Maui::Graphics::Rect> ^ value); };
public Action<Microsoft.Maui.Graphics.Rect> OnDisplay { get; set; }
member this.OnDisplay : Action<Microsoft.Maui.Graphics.Rect> with get, set
Public Property OnDisplay As Action(Of Rect)

Valeur de propriété

Remarques

En cas de substitution, crée un renderer personnalisé :

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;
};

S’applique à