Commit dd9ef2e0 authored by Pierre-Eric Pelloux-Prayer's avatar Pierre-Eric Pelloux-Prayer
Browse files

video: opengl rendering minor corrections

Uniforms were used without program set
parent 008a3f7b
......@@ -165,9 +165,11 @@ void ogl_display_render(struct opengles_display* gldisp) {
if (!gldisp->glResourcesInitialized)
return;
GL_OPERATION(glUseProgram(gldisp->program))
ms_mutex_lock(&gldisp->yuv_mutex);
if (gldisp->new_yuv_image) {
update_textures_with_yuv(gldisp);
update_textures_with_yuv(gldisp);
gldisp->new_yuv_image = FALSE;
}
ms_mutex_unlock(&gldisp->yuv_mutex);
......@@ -197,12 +199,21 @@ void ogl_display_render(struct opengles_display* gldisp) {
y = 0;
}
GL_OPERATION(glViewport(x, y, w, h))
GL_OPERATION(glUseProgram(gldisp->program))
GLfloat mat[16];
load_orthographic_matrix(0, 1.0f, 0, 1, 0, 1, mat);
GL_OPERATION(glUniformMatrix4fv(gldisp->uniforms[UNIFORM_MATRIX], 1, GL_FALSE, mat))
GL_OPERATION(glActiveTexture(GL_TEXTURE0))
GL_OPERATION(glBindTexture(GL_TEXTURE_2D, gldisp->textures[Y]))
GL_OPERATION(glUniform1i(gldisp->uniforms[UNIFORM_TEXTURE_Y], 0))
GL_OPERATION(glActiveTexture(GL_TEXTURE1))
GL_OPERATION(glBindTexture(GL_TEXTURE_2D, gldisp->textures[U]))
GL_OPERATION(glUniform1i(gldisp->uniforms[UNIFORM_TEXTURE_U], 1))
GL_OPERATION(glActiveTexture(GL_TEXTURE2))
GL_OPERATION(glBindTexture(GL_TEXTURE_2D, gldisp->textures[V]))
GL_OPERATION(glUniform1i(gldisp->uniforms[UNIFORM_TEXTURE_V], 2))
GL_OPERATION(glVertexAttribPointer(ATTRIB_VERTEX, 2, GL_FLOAT, 0, 0, squareVertices))
GL_OPERATION(glEnableVertexAttribArray(ATTRIB_VERTEX))
GL_OPERATION(glVertexAttribPointer(ATTRIB_UV, 2, GL_FLOAT, 1, 0, squareUvs))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment