Android OpenGL ES 包及流程摘要

來源:互聯網
上載者:User

android.opengl
-----
Class:    
    GLDebugHelper:用於調試OpenGL ES程式的協助類
    GLU:提供GL 公用工具功能的類
    GLUtils:串連OpenGL ES和Android API的工具類,其中提供了紋理圖片的操作。
    Matrix:矩陣運算工具類
Exception:    
    GLException:OpenGL異常類
   
------------------------------------------------   
javax.microedition.khronos.egl
-----
Interface:    
    EGL:GL的配置介面
    EGL10:GL1.0的配置介面
    EGL11:GL1.1的配置介面
Classes:    
    EGLConfig:GL配置的類
    EGLContext:GL運行環境的類
    EGLDisplay:GL顯示視窗的類
    EGLSurface:可渲染GL的視圖類
   
   
------------------------------------------------       
javax.microedition.khronos.opengles
-----
Interfaces:    
    GL:Opengles的介面
    GL10:Opengles1.0的介面
    GL10Ext:Opengles1.0的擴充介面
    GL11:Opengles1.1的介面
    GL11Ext:Opengles1.1的擴充介面
    GLExtentsionPack:Opengles的擴充介面
    EGLDisplay:GL顯示視窗的類
    EGLSurface:可渲染GL的視圖類

 

 

 

 

a)建立一個EGL執行個體

EGL10 mEgl = (EGL10) EGLContext.getEGL();

b)建立一個EGLDisplay執行個體

EGLDisplay mEglDisplay = mEgl.eglGetDisplay(EGL10.EGL_DEFAULT_DISPLAY);

c)初始化EGLDisplay

mEgl.eglInitialize(mEglDisplay, version);

d)選擇Config

mEgl.eglChooseConfig(mEglDisplay, configSpec, configs, 1, num_config);

EGLConfig mEglConfig = configs[0];

e)建立opengl運行環境

EGLContext mEglContext = mEgl.eglCreateContext(       mEglDisplay,

mEglConfig,

EGL10.EGL_NO_CONTEXT,

null);

f) 建立新surface

mEglSurface = mEgl.eglCreateWindowSurface(mEglDisplay,

mEglConfig, holder, null);

g) 將opengles環境設定為當前

mEgl.eglMakeCurrent(mEglDisplay, mEglSurface, mEglSurface,

mEglContext);

h) 擷取當前opengles畫布

GL gl = mEglContext.getGL();

i) 顯示繪製結果到螢幕上

mEgl.eglSwapBuffers(mEglDisplay, mEglSurface);

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.