Commit a910b4e7 authored by Laurent Aimar's avatar Laurent Aimar

Simplify/reorder a bit non shader rendering (openg).

parent b4eb37b2
......@@ -756,34 +756,23 @@ static void DrawWithoutShaders(vout_display_opengl_t *vgl,
right[0], top[0]
};
for (unsigned j = 0; j < vgl->chroma->plane_count; j++) {
glActiveTexture(GL_TEXTURE0 + j);
glClientActiveTexture(GL_TEXTURE0 + j);
glEnable(vgl->tex_target);
glActiveTexture(GL_TEXTURE0 + 0);
glClientActiveTexture(GL_TEXTURE0 + 0);
glBindTexture(vgl->tex_target, vgl->texture[0][0]);
glEnableClientState(GL_VERTEX_ARRAY);
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
glEnable(vgl->tex_target);
glBindTexture(vgl->tex_target, vgl->texture[0][j]);
glTexCoordPointer(2, GL_FLOAT, 0, textureCoord);
}
glActiveTexture(GL_TEXTURE0);
glClientActiveTexture(GL_TEXTURE0);
glVertexPointer(2, GL_FLOAT, 0, vertexCoord);
glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
for (unsigned j = 0; j < vgl->chroma->plane_count; j++) {
glActiveTexture(GL_TEXTURE0 + j);
glClientActiveTexture(GL_TEXTURE0 + j);
glDisable(vgl->tex_target);
glDisableClientState(GL_TEXTURE_COORD_ARRAY);
glDisableClientState(GL_VERTEX_ARRAY);
}
glActiveTexture(GL_TEXTURE0);
glClientActiveTexture(GL_TEXTURE0);
glDisable(vgl->tex_target);
}
static void DrawWithShaders(vout_display_opengl_t *vgl,
......@@ -869,12 +858,12 @@ int vout_display_opengl_Display(vout_display_opengl_t *vgl,
DrawWithoutShaders(vgl, left, top, right, bottom);
}
glActiveTexture(GL_TEXTURE0 + 0);
glClientActiveTexture(GL_TEXTURE0 + 0);
glEnable(GL_TEXTURE_2D);
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glActiveTexture(GL_TEXTURE0 + 0);
glClientActiveTexture(GL_TEXTURE0 + 0);
for (int i = 0; i < vgl->region_count; i++) {
gl_region_t *glr = &vgl->region[i];
const GLfloat vertexCoord[] = {
......@@ -899,11 +888,9 @@ int vout_display_opengl_Display(vout_display_opengl_t *vgl,
vgl->VertexAttribPointer(vgl->GetAttribLocation(vgl->program[1], "vertex_position"), 2, GL_FLOAT, 0, 0, vertexCoord);
} else {
glEnableClientState(GL_VERTEX_ARRAY);
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
glColor4f(1.0f, 1.0f, 1.0f, glr->alpha);
glEnable(GL_TEXTURE_COORD_ARRAY);
glEnable(GL_VERTEX_ARRAY);
glTexCoordPointer(2, GL_FLOAT, 0, textureCoord);
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
glVertexPointer(2, GL_FLOAT, 0, vertexCoord);
}
......
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