mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-17 18:30:58 +00:00
e69a583f1b
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).
21 lines
389 B
GLSL
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;
|
|
}
|