我正在使用Android中的OpenGL ES 2.0,并通过the docs for GLES20查看我遇到了以下方法:GLES20.glVertexAttribPointer/glDrawElements中的“offset”参数是什么,ptr/indices来自哪里?
public static void glDrawElements(
int mode, int count, int type, Buffer indices)
public static void glDrawElements(
int mode, int count, int type, int offset)
public static void glVertexAttribPointer(
int indx, int size, int type, boolean normalized, int stride, Buffer ptr)
public static void glVertexAttribPointer(
int indx, int size, int type, boolean normalized, int stride, int offset)
采用Buffer
对象的两种方法对我有意义,但另外两种方法不合适吨。他们在哪里获得index/attibute-values(分别),offset
是什么? (我假设这两个问题有相同的答案。)
这两个怪异的方法都被标记为“9级”,(目前我编码为8级),所以这更多的是满足我的好奇心比什么都重要...... –