summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorMatthew Waters <matthew@centricular.com>2017-08-17 13:42:21 +1000
committerTim-Philipp Müller <tim@centricular.com>2017-12-09 19:32:30 +0000
commit1dc074d401a39c304d5dc0e7328f2fddd72cc7b3 (patch)
treec24f965b22830809e40833624a4849c32be3c708 /ext
parent0214f4fb559977f198f0f151c1fce64394edd255 (diff)
gltransformation: draw with GL_TRIANGLES
Drawing 5 vertices with GL_TRIANGLE_STRIP will draw an extra unneeded triangle.
Diffstat (limited to 'ext')
-rw-r--r--ext/gl/gstgltransformation.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/ext/gl/gstgltransformation.c b/ext/gl/gstgltransformation.c
index 047fc7368..679e96181 100644
--- a/ext/gl/gstgltransformation.c
+++ b/ext/gl/gstgltransformation.c
@@ -253,7 +253,7 @@ gst_gl_transformation_init (GstGLTransformation * filter)
filter->fov = 90;
filter->aspect = 1.0;
filter->znear = 0.1f;
- filter->zfar = 100;
+ filter->zfar = 100.0;
filter->xscale = 1.0;
filter->yscale = 1.0;
@@ -853,7 +853,7 @@ gst_gl_transformation_filter_texture (GstGLFilter * filter,
return TRUE;
}
-static const GLushort indices[] = { 0, 1, 2, 3, 0 };
+static const GLushort indices[] = { 0, 1, 2, 0, 2, 3 };
static void
_upload_vertices (GstGLTransformation * transformation)
@@ -863,10 +863,10 @@ _upload_vertices (GstGLTransformation * transformation)
/* *INDENT-OFF* */
GLfloat vertices[] = {
- -transformation->aspect, 1.0, 0.0, 1.0, 0.0, 1.0,
- transformation->aspect, 1.0, 0.0, 1.0, 1.0, 1.0,
+ -transformation->aspect, -1.0, 0.0, 1.0, 0.0, 0.0,
transformation->aspect, -1.0, 0.0, 1.0, 1.0, 0.0,
- -transformation->aspect, -1.0, 0.0, 1.0, 0.0, 0.0
+ transformation->aspect, 1.0, 0.0, 1.0, 1.0, 1.0,
+ -transformation->aspect, 1.0, 0.0, 1.0, 0.0, 1.0,
};
/* *INDENT-ON* */
@@ -966,7 +966,7 @@ gst_gl_transformation_callback (gpointer stuff)
_upload_vertices (transformation);
_bind_buffer (transformation);
- gl->DrawElements (GL_TRIANGLE_STRIP, 5, GL_UNSIGNED_SHORT, 0);
+ gl->DrawElements (GL_TRIANGLES, 6, GL_UNSIGNED_SHORT, 0);
if (gl->GenVertexArrays)
gl->BindVertexArray (0);