語言

GLSurfaceView.IRenderer.OnSurfaceCreated(IGL10, EGLConfig) 方法

定義

當表面被創造或重建時被呼叫。

[Android.Runtime.Register("onSurfaceCreated", "(Ljavax/microedition/khronos/opengles/GL10;Ljavax/microedition/khronos/egl/EGLConfig;)V", "GetOnSurfaceCreated_Ljavax_microedition_khronos_opengles_GL10_Ljavax_microedition_khronos_egl_EGLConfig_Handler:Android.Opengl.GLSurfaceView/IRendererInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")]
public void OnSurfaceCreated(Javax.Microedition.Khronos.Opengles.IGL10? gl, Javax.Microedition.Khronos.Egl.EGLConfig? config);
[<Android.Runtime.Register("onSurfaceCreated", "(Ljavax/microedition/khronos/opengles/GL10;Ljavax/microedition/khronos/egl/EGLConfig;)V", "GetOnSurfaceCreated_Ljavax_microedition_khronos_opengles_GL10_Ljavax_microedition_khronos_egl_EGLConfig_Handler:Android.Opengl.GLSurfaceView/IRendererInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")>]
abstract member OnSurfaceCreated : Javax.Microedition.Khronos.Opengles.IGL10 * Javax.Microedition.Khronos.Egl.EGLConfig -> unit

參數

gl
IGL10

GL 介面。 用來 instanceof 測試介面是否支援 GL11 或更高等級的介面。

config
EGLConfig

所建立曲面的 EGLConfig 。 可用來建立匹配的 pbuffer。

屬性

備註

當表面被創造或重建時被呼叫。

當渲染執行緒開始且 EGL 上下文遺失時,會被呼叫。 當 Android 裝置從睡眠喚醒時,EGL 上下文通常會遺失。

由於此方法在渲染開始時及每次 EGL 上下文遺失時都會被呼叫,因此是放置程式碼以建立資源的方便地方,這些資源在渲染開始時必須建立,且在 EGL 上下文遺失時需要重新建立。 材質是一個你可能想在此建立的資源範例。

請注意,當 EGL 上下文遺失時,所有與該上下文相關的 OpenGL 資源將自動刪除。 你不需要呼叫對應的「glDelete」方法,例如 glDeleteTextures 來手動刪除這些遺失的資源。

Java 文件 android.opengl.GLSurfaceView.Renderer.onSurfaceCreated(javax.microedition.khronos.opengles.GL10, javax.microedition.khronos.egl.EGLConfig)。

本頁部分內容為基於 Open Source Project 所創建與分享的作品,並依授權條款所描述的使用進行修改。

適用於