summaryrefslogtreecommitdiff
path: root/src/table
diff options
context:
space:
mode:
authorMichael Lutz <michi@icosahedron.de>2021-01-16 16:43:21 +0100
committerMichael Lutz <michi@icosahedron.de>2021-02-22 22:16:07 +0100
commit90fd8f8cda72d8ce985f11c0f7bc1b3bcab68a6e (patch)
tree0b5f9651ebde6c713bf43a9cada854dc1f26a615 /src/table
parentacf59f6b68a3bdd068b4eddccd06749c5b411189 (diff)
downloadopenttd-90fd8f8cda72d8ce985f11c0f7bc1b3bcab68a6e.tar.xz
Codechange: [OpenGL] Use generic vertex attributes in the shader program.
Diffstat (limited to 'src/table')
-rw-r--r--src/table/opengl_shader.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/table/opengl_shader.h b/src/table/opengl_shader.h
index 43b2ca512..c59bcbcab 100644
--- a/src/table/opengl_shader.h
+++ b/src/table/opengl_shader.h
@@ -12,9 +12,11 @@
/** Vertex shader that just passes colour and tex coords through. */
static const char *_vertex_shader_direct[] = {
"#version 110\n",
+ "attribute vec2 position, colour_uv;",
+ "varying vec2 colour_tex_uv;",
"void main() {",
- " gl_TexCoord[0] = gl_MultiTexCoord0;",
- " gl_Position = gl_Vertex;",
+ " colour_tex_uv = colour_uv;",
+ " gl_Position = vec4(position, 0.0, 1.0);",
"}",
};
@@ -22,7 +24,8 @@ static const char *_vertex_shader_direct[] = {
static const char *_frag_shader_direct[] = {
"#version 110\n",
"uniform sampler2D colour_tex;",
+ "varying vec2 colour_tex_uv;",
"void main() {",
- " gl_FragColor = texture2D(colour_tex, gl_TexCoord[0].st);",
+ " gl_FragColor = texture2D(colour_tex, colour_tex_uv);",
"}",
};