Android OpenG开发者_如何学PythonL-ES VBO support or not? How can i check this?
Thanks
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.
void draw(GL10 gl){
GL11 gl11 = (GL11)gl;
...
gl11.glBindBuffer(...);
}
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.
精彩评论