summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Paul <brianp@vmware.com>2009-08-13 16:02:24 -0600
committerBrian Paul <brianp@vmware.com>2009-08-13 17:03:56 -0600
commit08ecd863ee12601ea95818e02889a9807fd7a62d (patch)
tree3c7278962b425f68b122f2fc8ffe4b7e78b63b38
parent62d113216090cd093c7cc6373c9115e31f921e7c (diff)
progs/glsl: set generic vertex attribute values
-rw-r--r--progs/glsl/shtest.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/progs/glsl/shtest.c b/progs/glsl/shtest.c
index 09b2593841..97f6f9f8a4 100644
--- a/progs/glsl/shtest.c
+++ b/progs/glsl/shtest.c
@@ -133,7 +133,20 @@ SquareVertex(GLfloat s, GLfloat t, GLfloat size)
{
GLfloat x = -size + s * 2.0 * size;
GLfloat y = -size + t * 2.0 * size;
- glTexCoord2f(s, t);
+ GLuint i;
+
+ glMultiTexCoord2f(GL_TEXTURE0, s, t);
+ glMultiTexCoord2f(GL_TEXTURE1, s, t);
+ glMultiTexCoord2f(GL_TEXTURE2, s, t);
+ glMultiTexCoord2f(GL_TEXTURE3, s, t);
+
+ /* assign (s,t) to the generic attributes */
+ for (i = 0; i < NumAttribs; i++) {
+ if (Attribs[i].location >= 0) {
+ glVertexAttrib2f(Attribs[i].location, s, t);
+ }
+ }
+
glVertex2f(x, y);
}
@@ -148,7 +161,7 @@ Square(GLfloat size)
glNormal3f(0, 0, 1);
glVertexAttrib3f(tangentAttrib, 1, 0, 0);
glBegin(GL_POLYGON);
-#if 0
+#if 1
SquareVertex(0, 0, size);
SquareVertex(1, 0, size);
SquareVertex(1, 1, size);