GLSurfaceView.IRenderer.OnSurfaceChanged(IGL10, Int32, Int32) Método
Definição
Importante
Algumas informações se referem a produtos de pré-lançamento que podem ser substancialmente modificados antes do lançamento. A Microsoft não oferece garantias, expressas ou implícitas, das informações aqui fornecidas.
Chamado quando a superfície mudou de tamanho.
[Android.Runtime.Register("onSurfaceChanged", "(Ljavax/microedition/khronos/opengles/GL10;II)V", "GetOnSurfaceChanged_Ljavax_microedition_khronos_opengles_GL10_IIHandler:Android.Opengl.GLSurfaceView/IRendererInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")]
public void OnSurfaceChanged(Javax.Microedition.Khronos.Opengles.IGL10? gl, int width, int height);
[<Android.Runtime.Register("onSurfaceChanged", "(Ljavax/microedition/khronos/opengles/GL10;II)V", "GetOnSurfaceChanged_Ljavax_microedition_khronos_opengles_GL10_IIHandler:Android.Opengl.GLSurfaceView/IRendererInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")>]
abstract member OnSurfaceChanged : Javax.Microedition.Khronos.Opengles.IGL10 * int * int -> unit
Parâmetros
- gl
- IGL10
a interface GL. Use instanceof para testar se a interface dá suporte a interfaces GL11 ou superiores.
- width
- Int32
width
- height
- Int32
height
- Atributos
Comentários
Chamado quando a superfície mudou de tamanho.
Chamado depois que a superfície é criada e sempre que o tamanho da superfície do OpenGL ES é alterado.
Normalmente, você definirá seu visor aqui. Se a câmera estiver fixa, você também poderá definir a matriz de projeção aqui:
void onSurfaceChanged(GL10 gl, int width, int height) {
gl.glViewport(0, 0, width, height);
// for a fixed camera, set the projection too
float ratio = (float) width / height;
gl.glMatrixMode(GL10.GL_PROJECTION);
gl.glLoadIdentity();
gl.glFrustumf(-ratio, ratio, -1, 1, 1, 10);
}
Partes desta página são modificações baseadas no trabalho criado e compartilhado pelo Project Open Source do Open Source e usadas de acordo com os termos descritos na Creative Commons 2.5.