summaryrefslogtreecommitdiff
path: root/render
diff options
context:
space:
mode:
authorDerek Foreman <manmower@gmail.com>2003-05-25 03:17:29 +0000
committerDerek Foreman <manmower@gmail.com>2003-05-25 03:17:29 +0000
commitf9505b23b7796219ecc73ad97c68764356797163 (patch)
tree39c298d9f66829d5339483e20184069bb721fbe9 /render
parentd6652d0a90bd6c93084b0b9e6cf36123e0ec15d1 (diff)
pipecross
Diffstat (limited to 'render')
-rw-r--r--render/gradient.c126
-rw-r--r--render/test.c2
2 files changed, 85 insertions, 43 deletions
diff --git a/render/gradient.c b/render/gradient.c
index aedd3bbe..ce066b21 100644
--- a/render/gradient.c
+++ b/render/gradient.c
@@ -543,41 +543,41 @@ void render_gl_gradient(Surface *sf, int x, int y, int w, int h)
case Background_Solid: /* already handled */
glBegin(GL_TRIANGLES);
glColor3f(pr, pg, pb);
- glVertex3i(x, y, 0);
- glVertex3i(x+w, y, 0);
- glVertex3i(x+w, y+h, 0);
+ glVertex2i(x, y);
+ glVertex2i(x+w, y);
+ glVertex2i(x+w, y+h);
- glVertex3i(x+w, y+h, 0);
- glVertex3i(x, y+h, 0);
- glVertex3i(x, y, 0);
+ glVertex2i(x+w, y+h);
+ glVertex2i(x, y+h);
+ glVertex2i(x, y);
glEnd();
return;
case Background_Horizontal:
glBegin(GL_TRIANGLES);
glColor3f(pr, pg, pb);
- glVertex3i(x, y, 0);
+ glVertex2i(x, y);
glColor3f(sr, sg, sb);
- glVertex3i(x+w, y, 0);
- glVertex3i(x+w, y+h, 0);
+ glVertex2i(x+w, y);
+ glVertex2i(x+w, y+h);
- glVertex3i(x+w, y+h, 0);
+ glVertex2i(x+w, y+h);
glColor3f(pr, pg, pb);
- glVertex3i(x, y+h, 0);
- glVertex3i(x, y, 0);
+ glVertex2i(x, y+h);
+ glVertex2i(x, y);
glEnd();
break;
case Background_Vertical:
glBegin(GL_TRIANGLES);
glColor3f(pr, pg, pb);
- glVertex3i(x, y, 0);
- glVertex3i(x+w, y, 0);
+ glVertex2i(x, y);
+ glVertex2i(x+w, y);
glColor3f(sr, sg, sb);
- glVertex3i(x+w, y+h, 0);
+ glVertex2i(x+w, y+h);
- glVertex3i(x+w, y+h, 0);
- glVertex3i(x, y+h, 0);
+ glVertex2i(x+w, y+h);
+ glVertex2i(x, y+h);
glColor3f(pr, pg, pb);
- glVertex3i(x, y, 0);
+ glVertex2i(x, y);
glEnd();
break;
case Background_Diagonal:
@@ -586,18 +586,18 @@ void render_gl_gradient(Surface *sf, int x, int y, int w, int h)
ab = (pb + sb) / 2.0;
glBegin(GL_TRIANGLES);
glColor3f(ar, ag, ab);
- glVertex3i(x, y, 0);
+ glVertex2i(x, y);
glColor3f(pr, pg, pb);
- glVertex3i(x+w, y, 0);
+ glVertex2i(x+w, y);
glColor3f(ar, ag, ab);
- glVertex3i(x+w, y+h, 0);
+ glVertex2i(x+w, y+h);
glColor3f(ar, ag, ab);
- glVertex3i(x+w, y+h, 0);
+ glVertex2i(x+w, y+h);
glColor3f(sr, sg, sb);
- glVertex3i(x, y+h, 0);
+ glVertex2i(x, y+h);
glColor3f(ar, ag, ab);
- glVertex3i(x, y, 0);
+ glVertex2i(x, y);
glEnd();
break;
case Background_CrossDiagonal:
@@ -606,51 +606,93 @@ void render_gl_gradient(Surface *sf, int x, int y, int w, int h)
ab = (pb + sb) / 2.0;
glBegin(GL_TRIANGLES);
glColor3f(pr, pg, pb);
- glVertex3i(x, y, 0);
+ glVertex2i(x, y);
glColor3f(ar, ag, ab);
- glVertex3i(x+w, y, 0);
+ glVertex2i(x+w, y);
glColor3f(sr, sg, sb);
- glVertex3i(x+w, y+h, 0);
+ glVertex2i(x+w, y+h);
glColor3f(sr, sg, sb);
- glVertex3i(x+w, y+h, 0);
+ glVertex2i(x+w, y+h);
glColor3f(ar, ag, ab);
- glVertex3i(x, y+h, 0);
+ glVertex2i(x, y+h);
glColor3f(pr, pg, pb);
- glVertex3i(x, y, 0);
+ glVertex2i(x, y);
glEnd();
break;
case Background_Pyramid:
printf("pyramid\n");
break;
case Background_PipeCross:
+ glBegin(GL_TRIANGLES);
+ glColor3f(pr, pg, pb);
+ glVertex2i(x, y);
+ glColor3f(sr, sg, sb);
+ glVertex2i(x+w/2, y+h/2);
+ glVertex2i(x, y+h/2);
+
+ glVertex2i(x, y+h/2);
+ glVertex2i(x+w/2, y+h/2);
+ glColor3f(pr, pg, pb);
+ glVertex2i(x, y+h);
+
+ glVertex2i(x, y+h);
+ glColor3f(sr, sg, sb);
+ glVertex2i(x+w/2, y+h/2);
+ glVertex2i(x+w/2, y+h);
+
+ glVertex2i(x+w/2, y+h);
+ glVertex2i(x+w/2, y+h/2);
+ glColor3f(pr, pg, pb);
+ glVertex2i(x+w, y+h);
+
+ glVertex2i(x+w, y+h);
+ glColor3f(sr, sg, sb);
+ glVertex2i(x+w/2, y+h/2);
+ glVertex2i(x+w, y+h/2);
+
+ glVertex2i(x+w, y+h/2);
+ glVertex2i(x+w/2, y+h/2);
+ glColor3f(pr, pg, pb);
+ glVertex2i(x+w, y);
+
+ glVertex2i(x+w, y);
+ glColor3f(sr, sg, sb);
+ glVertex2i(x+w/2, y+h/2);
+ glVertex2i(x+w/2, y);
+
+ glVertex2i(x+w/2, y);
+ glVertex2i(x+w/2, y+h/2);
+ glColor3f(pr, pg, pb);
+ glVertex2i(x, y);
+ glEnd();
break;
case Background_Rectangle:
glBegin(GL_TRIANGLES);
glColor3f(pr, pg, pb);
- glVertex3i(x, y, 0);
+ glVertex2i(x, y);
glColor3f(sr, sg, sb);
- glVertex3i(x+w/2, y+h/2, 0);
+ glVertex2i(x+w/2, y+h/2);
glColor3f(pr, pg, pb);
- glVertex3i(x, y+h, 0);
+ glVertex2i(x, y+h);
- glVertex3i(x, y+h, 0);
+ glVertex2i(x, y+h);
glColor3f(sr, sg, sb);
- glVertex3i(x+w/2, y+h/2, 0);
+ glVertex2i(x+w/2, y+h/2);
glColor3f(pr, pg, pb);
- glVertex3i(x+w, y+h, 0);
+ glVertex2i(x+w, y+h);
- glVertex3i(x+w, y+h, 0);
+ glVertex2i(x+w, y+h);
glColor3f(sr, sg, sb);
- glVertex3i(x+w/2, y+h/2, 0);
+ glVertex2i(x+w/2, y+h/2);
glColor3f(pr, pg, pb);
- glVertex3i(x+w, y, 0);
+ glVertex2i(x+w, y);
- glVertex3i(x+w, y, 0);
+ glVertex2i(x+w, y);
glColor3f(sr, sg, sb);
- glVertex3i(x+w/2, y+h/2, 0);
+ glVertex2i(x+w/2, y+h/2);
glColor3f(pr, pg, pb);
- glVertex3i(x, y, 0);
+ glVertex2i(x, y);
glEnd();
break;
diff --git a/render/test.c b/render/test.c
index 2170a341..f737748f 100644
--- a/render/test.c
+++ b/render/test.c
@@ -51,7 +51,7 @@ int main()
render_startup();
look = appearance_new(Surface_Planar, 0);
- look->surface.data.planar.grad = Background_Rectangle;
+ look->surface.data.planar.grad = Background_PipeCross;
look->surface.data.planar.secondary = color_parse("Yellow");
look->surface.data.planar.primary = color_parse("Blue");
look->surface.data.planar.interlaced = FALSE;