Skip to content

Instantly share code, notes, and snippets.

@appspell
Created March 4, 2021 13:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save appspell/8b6ac1394928b143a97a5dc27bafc7ad to your computer and use it in GitHub Desktop.
Save appspell/8b6ac1394928b143a97a5dc27bafc7ad to your computer and use it in GitHub Desktop.
private const val FLOAT_SIZE_BYTES = 4 // size of Float
private const val TRIANGLE_VERTICES_DATA_STRIDE_BYTES = 5 * FLOAT_SIZE_BYTES // 5 floats for each vertex (3 floats is a position and 2 texture coordinate)
private const val TRIANGLE_VERTICES_DATA_POS_OFFSET = 0 // position coordinates start from the starts from the start of array of each vertex
private const val TRIANGLE_VERTICES_DATA_UV_OFFSET = 3 // texture coordinates start from 3rd float (4th and 5th float)
// vertex shader attributes
const val VERTEX_SHADER_IN_POSITION = "inPosition"
const val VERTEX_SHADER_IN_TEXTURE_COORD = "inTextureCoord"
const val VERTEX_SHADER_UNIFORM_MATRIX_MVP = "uMVPMatrix"
const val VERTEX_SHADER_UNIFORM_MATRIX_STM = "uSTMatrix"
const val FRAGMENT_SHADER_UNIFORM_MY_UNIFORM = "uMyUniform"
private const val UNKNOWN_PROGRAM = -1
private const val UNKNOWN_ATTRIBUTE = -1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment