Edit

Share via


iPhoneOSGameView.CreateFrameBuffer Method

Definition

Creates the framebuffer so that OpenGL operations can be performed.

protected virtual void CreateFrameBuffer ();
abstract member CreateFrameBuffer : unit -> unit
override this.CreateFrameBuffer : unit -> unit

Exceptions

ContextRenderingApi hasn't been initialized.

LayerColorFormat hasn't been initialized.

The instance has had Dispose(Boolean) invoked on it.

Remarks

This method is invoked to create an IGraphicsContext implementation, create a EAGLContext, and initialize the GL context so that a framebuffer and renderbuffer exist for future GL calls.

This method is invoked by: LayoutSubviews(), Run(), and Run(Double).

protected override CreateFrameBuffer()
{
    try {
        ContextRenderingApi = EAGLRenderingAPI.OpenGLES2;
        base.CreateFrameBuffer();
    } catch (Exception) {
        // device doesn't support OpenGLES 2.0; retry with 1.1:
        ContextRenderingApi = EAGLRenderingAPI.OpenGLES1;
        base.CreateFrameBuffer();
    }
}

Applies to