#include "gl.h"
#include "gstglshader.h"
-#if GST_GL_HAVE_GLES2
/* *INDENT-OFF* */
static const gchar *simple_vertex_shader_str_gles2 =
"attribute vec4 a_position; \n"
"} \n";
static const gchar *simple_fragment_shader_str_gles2 =
+ "#ifdef GL_ES \n"
"precision mediump float; \n"
+ "#endif \n"
"varying vec2 v_texCoord; \n"
"uniform sampler2D tex; \n"
"void main() \n"
" gl_FragColor = texture2D( tex, v_texCoord ); \n"
"} \n";
/* *INDENT-ON* */
-#endif
#ifndef GL_COMPILE_STATUS
#define GL_COMPILE_STATUS 0x8B81
return TRUE;
}
-#if GST_GL_HAVE_GLES2
gboolean
gst_gl_shader_compile_with_default_f_and_check (GstGLShader * shader,
const gchar * v_src, const gint n_attribs, const gchar * attrib_names[],
return gst_gl_shader_compile_with_default_v_and_check (shader,
simple_fragment_shader_str_gles2, pos_loc, tex_loc);
}
-#endif
void
gst_gl_shader_set_uniform_1f (GstGLShader * shader, const gchar * name,
gboolean gst_gl_shader_compile (GstGLShader *shader, GError **error);
gboolean gst_gl_shader_compile_and_check (GstGLShader *shader, const gchar *source, GstGLShaderSourceType type);
gboolean gst_gl_shader_compile_all_with_attribs_and_check (GstGLShader *shader, const gchar *v_src, const gchar *f_src, const gint n_attribs, const gchar *attrib_names[], GLint attrib_locs[]);
-#if GST_GL_HAVE_GLES2
gboolean gst_gl_shader_compile_with_default_f_and_check (GstGLShader *shader, const gchar *v_src, const gint n_attribs, const gchar *attrib_names[], GLint attrib_locs[]);
gboolean gst_gl_shader_compile_with_default_v_and_check (GstGLShader *shader, const gchar *f_src, GLint *pos_loc, GLint *tex_loc);
gboolean gst_gl_shader_compile_with_default_vf_and_check (GstGLShader *shader, GLint *pos_loc, GLint *tex_loc);
-#endif
void gst_gl_shader_release (GstGLShader *shader);
void gst_gl_shader_use (GstGLShader *shader);