32 {0.0, 0.0, 0.0, 1.0, 1.0, 0.0, 1.0, 1.0};
40 LOGE(
"Could not create program.");
44 glBindTexture(GL_TEXTURE_EXTERNAL_OES,
texture_id_);
45 glTexParameteri(GL_TEXTURE_EXTERNAL_OES, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
46 glTexParameteri(GL_TEXTURE_EXTERNAL_OES, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
52 glBufferData(GL_ARRAY_BUFFER,
sizeof(GLfloat) * 3 * 4,
kVertices,
54 glBindBuffer(GL_ARRAY_BUFFER, 0);
58 glBufferData(GL_ELEMENT_ARRAY_BUFFER,
sizeof(GLushort) * 6,
kIndices,
60 glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);
64 glBufferData(GL_ARRAY_BUFFER,
sizeof(GLfloat) * 2 * 4,
kTextureCoords,
66 glBindBuffer(GL_ARRAY_BUFFER, 0);
73 glBindBuffer(GL_ARRAY_BUFFER, 0);
81 glBindBuffer(GL_ARRAY_BUFFER, 0);
91 glActiveTexture(GL_TEXTURE0);
92 glBindTexture(GL_TEXTURE_EXTERNAL_OES,
texture_id_);
95 glm::mat4 mvp_mat = projection_mat * view_mat * model_mat;
102 glBindBuffer(GL_ARRAY_BUFFER, 0);
109 glBindBuffer(GL_ARRAY_BUFFER, 0);
113 glDrawElements(GL_TRIANGLES, 6, GL_UNSIGNED_SHORT, 0);
115 glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);