Skip to content

Instantly share code, notes, and snippets.

@comoc
Last active December 27, 2015 04:09
Show Gist options
  • Save comoc/7265141 to your computer and use it in GitHub Desktop.
Save comoc/7265141 to your computer and use it in GitHub Desktop.
In OpenGL ES, the API specification of glDrawElements, type must be GL_UNSIGNED_BYTE or GL_UNSIGNED_SHORT.
As you can see in http://www.khronos.org/opengles/sdk/docs/man/xhtml/glDrawElements.xml
void glDrawElements( GLenum mode,
GLsizei count,
GLenum type,
const GLvoid * indices);
type
Specifies the type of the values in indices. Must be GL_UNSIGNED_BYTE or GL_UNSIGNED_SHORT.
CAUTION
In the case of Android, we set indices value as ByteBuffer or ShortBuffer.
However, we MUST set the type either GL_UNSIGNED_BYTE or GL_UNSIGNED_SHORT.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment