Skip to content

Instantly share code, notes, and snippets.

@appspell
Created Mar 4, 2021
Embed
What would you like to do?
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