Android OpenGL-ES VBO support or not?

一个人想着一个人 提交于 2019-12-13 12:09:52

问题


Android OpenGL-ES VBO support or not? How can i check this?

Thanks


回答1:


Some phones support it, some do not. Generally, VBOs are mandatory in OpenGL 1.1, so if the device reports

gl.glGetString(GL10.GL_VERSION);

as 1.1 or higher (you can also write the app manifest file so that 1.1 is required for the installation) then they are supported.

If the device support OpenGL ES 1.0 only, you should check the return value of

gl.glGetString(GL10.GL_EXTENSIONS);

whether it contains ARB_vertex_buffer_object or not. Probably it will.

For (slightly) related information about various GL capabilities of Android devices, you can find some at this question: OpenGL extensions available on different Android devices.




回答2:


void draw(GL10 gl){
    GL11 gl11 = (GL11)gl;
    ...
    gl11.glBindBuffer(...);
}



回答3:


OpenGL ES 2.0 supports VBOs well, but there is issue in Android 2.2 which misses an api in GLES20 class:

public static native void glDrawElements(
    int mode,
    int count,
    int type,
    int offset
);

The issue has been fixed from Android 2.3.



来源:https://stackoverflow.com/questions/5314115/android-opengl-es-vbo-support-or-not

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!