static const char *default_vertex_source = "attribute vec4 pos;\n" "attribute vec4 color;\n" "attribute vec2 texcoord;\n" "uniform mat4 projview_matrix;\n" "varying vec4 varying_color;\n" "varying vec2 varying_texcoord;\n" "void main()\n" "{\n" " varying_color = color;\n" " varying_texcoord = texcoord;\n" " gl_Position = projview_matrix * pos;\n" "}\n"; static const char *default_pixel_source = "precision mediump float;\n" "uniform bool use_tex;\n" "uniform sampler2D tex;\n" "uniform bool use_tex_matrix;\n" "uniform mat4 tex_matrix;\n" "varying vec4 varying_color;\n" "varying vec2 varying_texcoord;\n" "void main()\n" "{\n" " vec4 tmp = varying_color;\n" " vec4 coord = vec4(varying_texcoord, 0.0, 1.0);\n" " if (use_tex_matrix) {\n" " coord = coord * tex_matrix;\n" " vec4 sample = texture2D(tex, coord.st);\n" " tmp *= sample;\n" " }\n" " else if (use_tex) {\n" " vec4 sample = texture2D(tex, coord.st);\n" " tmp *= sample;\n" " }\n" " gl_FragColor = tmp;\n" "}\n";