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);
GLuint CreateProgram(const char *vertex_source, const char *fragment_source)
GLM_FUNC_DECL genType::value_type const * value_ptr(genType const &vec)
static const GLfloat kTextureCoords[]
static const GLfloat kVertices[]
std::string GetVideoOverlayVertexShader()
std::string GetVideoOverlayFragmentShader()
void glUniformMatrix4fv(GLuint, int, int, float *)
void CheckGlError(const char *operation)
GLuint vertex_buffers_[3]
GLuint attrib_texture_coords_
static const GLushort kIndices[]
void Render(const glm::mat4 &projection_mat, const glm::mat4 &view_mat) const
#define GL_VERTEX_PROGRAM_POINT_SIZE