iPhoneOSGameView.CreateFrameBuffer 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
建立框架緩衝區,以便執行 OpenGL 作業。
protected virtual void CreateFrameBuffer ();
abstract member CreateFrameBuffer : unit -> unit
override this.CreateFrameBuffer : unit -> unit
例外狀況
實例已在 Dispose(Boolean) 該實例上叫用。
備註
系統會叫用這個方法來建立 IGraphicsContext 實作、建立 EAGLContext ,並初始化 GL 內容,讓框架緩衝區和轉譯器可供未來的 GL 呼叫使用。
此方法由: LayoutSubviews() 、 Run() 和 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();
}
}