Example #1
0
/**
 * gst_gl_shader_get_attribute_location:
 * @shader: a #GstGLShader
 * @name: name of the attribute
 *
 * Returns: the attribute index for @name in @shader or -1 on failure
 */
GLint
gst_gl_shader_get_attribute_location (GstGLShader * shader, const gchar * name)
{
  GstGLShaderPrivate *priv;
  GstGLFuncs *gl;
  gint ret;

  g_return_val_if_fail (shader != NULL, -1);
  priv = shader->priv;
  g_return_val_if_fail (priv->program_handle != 0, -1);

  gl = shader->context->gl_vtable;

  ret = gl->GetAttribLocation (priv->program_handle, name);

  GST_TRACE_OBJECT (shader, "retreived program %i attribute \'%s\' location %i",
      (int) priv->program_handle, name, ret);

  return ret;
}