quakeforge/libs/video/renderer/glsl/quakeico.vert
Bill Currie e69a583f1b Work around a bug in mesa.
Since I'm not specifying the api when creating my context, mesa is giving
me GL2. This is fair enough, but in GL2, vertex attribute 0 is the vertex
position. This too, is fair enough. The problem is, mesa is assigning 0 to
my vcolor attribute and thus I can't set it. The work around is simply to
swap the declaration order of vcolor and vertex (this really shouldn't work
eiter, I suspect).
2011-12-28 20:43:56 +09:00

21 lines
389 B
GLSL

uniform mat4 mvp_mat;
attribute vec4 vcolor;
/** Vertex position.
x, y, s, t
\a vertex provides the onscreen location at which to draw the icon
(\a x, \a y) and texture coordinate for the icon (\a s=z, \a t=w).
*/
attribute vec4 vertex;
varying vec4 color;
varying vec2 st;
void
main (void)
{
gl_Position = mvp_mat * vec4 (vertex.xy, 0.0, 1.0);
st = vertex.zw;
color = vcolor;
}