Vertex Buffer Objects in support android SDK 2.2
I am making a program with opengl es 2.0 for android.
I was planning on using VBO's to store my vertex data. But when I started to do so I noticed I am missing the function
glDrawElements()
with an overide which takes the offset into the buffer as the last parameter instead of the buffer itself.
I noticed the following quote on a release summorization of android 2.3
Graphics: Adds remaining OpenGL ES 2.0 methods glDrawElements() and glVertexAttribPointer() in the android.opengl.GLES20 class.
Has there been no support for this in android 2.2?
If so is there an alternative way to do this? (I don't want to use the NDK just because of this)
The only solution I have thought of so far is to u开发者_StackOverflow社区se VBO's only if the android version is 2.3+. But i'd rather use them all the time if I can
This link explains how to use VBO very clearly, even on Android 2.2. http://www.learnopengles.com/android-lesson-seven-an-introduction-to-vertex-buffer-objects-vbos/
To summarize: "The option I recommend, and that I have decided to go with, is to use your own JNI bindings. For this lesson I have decided to go with the bindings generously provided by the guys who created libgdx, a cross-platform game development library licensed under the Apache License 2.0. You need to use the following files to make it work:
/libs/armeabi/libandroidgl20.so
/libs/armeabi-v7a/libandroidgl20.so
src/com/badlogic/gdx/backends/android/AndroidGL20.java
src/com/badlogic/gdx/graphics/GL20.java
src/com/badlogic/gdx/graphics/GLCommon.java
"
libgx downlaod link: http://code.google.com/p/libgdx/
This capability is only supported from 2.3 and above :S
(Why would they not just complete these methods before the release??)
There is an alternative call in android-8. Will this work for you?
In other words, no, the offset version is not available.
精彩评论