mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-05-21 06:45:39 -06:00
.cosmetics
git-svn-id: svn://ultimatepp.org/upp/trunk@11847 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
54fd84c1f4
commit
d154ff698f
1 changed files with 59 additions and 84 deletions
|
|
@ -23,7 +23,6 @@ void initializeGL()
|
||||||
{
|
{
|
||||||
glewInit();
|
glewInit();
|
||||||
|
|
||||||
|
|
||||||
gl_image.Create(R"(
|
gl_image.Create(R"(
|
||||||
attribute vec4 a_position;
|
attribute vec4 a_position;
|
||||||
attribute vec2 a_texCoord;
|
attribute vec2 a_texCoord;
|
||||||
|
|
@ -35,76 +34,51 @@ void initializeGL()
|
||||||
v_texCoord = a_texCoord;
|
v_texCoord = a_texCoord;
|
||||||
}
|
}
|
||||||
)", R"(
|
)", R"(
|
||||||
#ifdef GL_ES
|
#ifdef GL_ES
|
||||||
precision mediump float;
|
precision mediump float;
|
||||||
precision mediump int;
|
precision mediump int;
|
||||||
#endif
|
#endif
|
||||||
varying vec2 v_texCoord;
|
varying vec2 v_texCoord;
|
||||||
uniform sampler2D s_texture;
|
uniform sampler2D s_texture;
|
||||||
void main()
|
void main()
|
||||||
{
|
{
|
||||||
gl_FragColor = texture2D(s_texture, v_texCoord);
|
gl_FragColor = texture2D(s_texture, v_texCoord);
|
||||||
}
|
}
|
||||||
)",
|
)",
|
||||||
ATTRIB_VERTEX, "a_position",
|
ATTRIB_VERTEX, "a_position",
|
||||||
ATTRIB_TEXPOS, "a_texCoord"
|
ATTRIB_TEXPOS, "a_texCoord"
|
||||||
);
|
);
|
||||||
|
|
||||||
/*
|
|
||||||
gl_image.Create(
|
|
||||||
"attribute vec4 a_position; \n"
|
|
||||||
"attribute vec2 a_texCoord; \n"
|
|
||||||
"uniform mat4 u_projection; \n"
|
|
||||||
"varying vec2 v_texCoord; \n"
|
|
||||||
"void main() \n"
|
|
||||||
"{ \n"
|
|
||||||
" gl_Position = u_projection * a_position; \n"
|
|
||||||
" v_texCoord = a_texCoord; \n"
|
|
||||||
"} \n"
|
|
||||||
,
|
|
||||||
"#ifdef GL_ES\n"
|
|
||||||
"precision mediump float; \n"
|
|
||||||
"precision mediump int; \n"
|
|
||||||
"#endif\n"
|
|
||||||
"varying vec2 v_texCoord; \n"
|
|
||||||
"uniform sampler2D s_texture; \n"
|
|
||||||
"void main() \n"
|
|
||||||
"{ \n"
|
|
||||||
" gl_FragColor = texture2D(s_texture, v_texCoord); \n"
|
|
||||||
"} \n",
|
|
||||||
ATTRIB_VERTEX, "a_position",
|
|
||||||
ATTRIB_TEXPOS, "a_texCoord"
|
|
||||||
);
|
|
||||||
*/
|
|
||||||
glUniform1i(gl_image.GetUniform("s_texture"), 0);
|
glUniform1i(gl_image.GetUniform("s_texture"), 0);
|
||||||
|
|
||||||
gl_image_colored.Create(
|
gl_image_colored.Create(R"(
|
||||||
"attribute vec4 a_position; \n"
|
attribute vec4 a_position;
|
||||||
"attribute vec2 a_texCoord; \n"
|
attribute vec2 a_texCoord;
|
||||||
"attribute vec4 a_color; \n"
|
attribute vec4 a_color;
|
||||||
"uniform mat4 u_projection; \n"
|
uniform mat4 u_projection;
|
||||||
"varying vec2 v_texCoord; \n"
|
varying vec2 v_texCoord;
|
||||||
"varying vec4 v_color; \n"
|
varying vec4 v_color;
|
||||||
"void main() \n"
|
void main()
|
||||||
"{ \n"
|
{
|
||||||
" gl_Position = u_projection * a_position; \n"
|
gl_Position = u_projection * a_position;
|
||||||
" v_texCoord = a_texCoord; \n"
|
v_texCoord = a_texCoord;
|
||||||
" v_color = a_color * vec4((1.0 / 255.0), (1.0 / 255.0), (1.0 / 255.0), 1); \n"
|
v_color = a_color * vec4((1.0 / 255.0), (1.0 / 255.0), (1.0 / 255.0), 1);
|
||||||
"} \n"
|
}
|
||||||
,
|
)", R"(
|
||||||
"#ifdef GL_ES\n"
|
#ifdef GL_ES
|
||||||
"precision mediump float; \n"
|
precision mediump float;
|
||||||
"precision mediump int; \n"
|
precision mediump int;
|
||||||
"#endif\n"
|
#endif
|
||||||
"varying vec2 v_texCoord; \n"
|
varying vec2 v_texCoord;
|
||||||
"varying vec4 v_color; \n"
|
varying vec4 v_color;
|
||||||
"uniform sampler2D s_texture; \n"
|
uniform sampler2D s_texture;
|
||||||
"void main() \n"
|
void main()
|
||||||
"{ \n"
|
{
|
||||||
" gl_FragColor = texture2D(s_texture, v_texCoord); \n"
|
gl_FragColor = texture2D(s_texture, v_texCoord);
|
||||||
" gl_FragColor = v_color;\n"
|
gl_FragColor = v_color;
|
||||||
" gl_FragColor[3] = texture2D(s_texture, v_texCoord)[3]; \n"
|
gl_FragColor[3] = texture2D(s_texture, v_texCoord)[3];
|
||||||
"} \n",
|
}
|
||||||
|
)",
|
||||||
ATTRIB_VERTEX, "a_position",
|
ATTRIB_VERTEX, "a_position",
|
||||||
ATTRIB_TEXPOS, "a_texCoord",
|
ATTRIB_TEXPOS, "a_texCoord",
|
||||||
ATTRIB_COLOR, "a_color"
|
ATTRIB_COLOR, "a_color"
|
||||||
|
|
@ -112,26 +86,27 @@ void initializeGL()
|
||||||
|
|
||||||
glUniform1i(gl_image_colored.GetUniform("s_texture"), 0);
|
glUniform1i(gl_image_colored.GetUniform("s_texture"), 0);
|
||||||
|
|
||||||
gl_rect.Create(
|
gl_rect.Create(R"(
|
||||||
"attribute vec4 a_position; \n"
|
attribute vec4 a_position;
|
||||||
"attribute vec4 a_color; \n"
|
attribute vec4 a_color;
|
||||||
"uniform mat4 u_projection; \n"
|
uniform mat4 u_projection;
|
||||||
"varying vec4 v_color; \n"
|
varying vec4 v_color;
|
||||||
"void main() \n"
|
void main()
|
||||||
"{ \n"
|
{
|
||||||
" gl_Position = u_projection * a_position; \n"
|
gl_Position = u_projection * a_position;
|
||||||
" v_color = a_color * vec4((1.0 / 255.0), (1.0 / 255.0), (1.0 / 255.0), 1); \n"
|
v_color = a_color * vec4((1.0 / 255.0), (1.0 / 255.0), (1.0 / 255.0), 1);
|
||||||
"}"
|
}
|
||||||
,
|
)", R"(
|
||||||
"#ifdef GL_ES\n"
|
#ifdef GL_ES
|
||||||
"precision mediump float;\n"
|
precision mediump float;
|
||||||
"precision mediump int;\n"
|
precision mediump int;
|
||||||
"#endif\n"
|
#endif
|
||||||
"varying vec4 v_color;\n"
|
varying vec4 v_color;
|
||||||
"void main()\n"
|
void main()
|
||||||
"{\n"
|
{
|
||||||
" gl_FragColor = v_color;\n"
|
gl_FragColor = v_color;
|
||||||
"}",
|
}
|
||||||
|
)",
|
||||||
ATTRIB_VERTEX, "a_position",
|
ATTRIB_VERTEX, "a_position",
|
||||||
ATTRIB_COLOR, "a_color"
|
ATTRIB_COLOR, "a_color"
|
||||||
);
|
);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue