]> Dogcows Code - chaz/openbox/commitdiff
all grads done
authorDerek Foreman <manmower@gmail.com>
Sun, 25 May 2003 03:36:12 +0000 (03:36 +0000)
committerDerek Foreman <manmower@gmail.com>
Sun, 25 May 2003 03:36:12 +0000 (03:36 +0000)
render/gradient.c
render/test.c

index ce066b21046662b60d820c16681a8a6053c301de..6b22c6ba412d7a387ade36b5df05fa18eef5edea 100644 (file)
@@ -621,7 +621,59 @@ void render_gl_gradient(Surface *sf, int x, int y, int w, int h)
         glEnd();
         break;
     case Background_Pyramid:
-printf("pyramid\n");
+       ar = (pr + sr) / 2.0;
+       ag = (pg + sg) / 2.0;
+       ab = (pb + sb) / 2.0;
+        glBegin(GL_TRIANGLES);
+        glColor3f(pr, pg, pb);
+        glVertex2i(x, y);
+        glColor3f(sr, sg, sb);
+        glVertex2i(x+w/2, y+h/2);
+        glColor3f(ar, ag, ab);
+        glVertex2i(x, y+h/2);
+
+        glVertex2i(x, y+h/2);
+        glColor3f(sr, sg, sb);
+        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);
+        glColor3f(ar, ag, ab);
+        glVertex2i(x+w/2, y+h);
+
+        glVertex2i(x+w/2, y+h);
+        glColor3f(sr, sg, sb);
+        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);
+        glColor3f(ar, ag, ab);
+        glVertex2i(x+w, y+h/2);
+
+        glVertex2i(x+w, y+h/2);
+        glColor3f(sr, sg, sb);
+        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);
+        glColor3f(ar, ag, ab);
+        glVertex2i(x+w/2, y);
+
+        glVertex2i(x+w/2, y);
+        glColor3f(sr, sg, sb);
+        glVertex2i(x+w/2, y+h/2);
+        glColor3f(pr, pg, pb);
+        glVertex2i(x, y);
+        glEnd();
         break;
     case Background_PipeCross:
         glBegin(GL_TRIANGLES);
index f737748f9c32a1fe5f0a0133425858c708cca16f..7c3c83b3a4e5877ea6f64100426b607940ed7285 100644 (file)
@@ -51,7 +51,7 @@ int main()
        render_startup();
 
        look = appearance_new(Surface_Planar, 0);
-       look->surface.data.planar.grad = Background_PipeCross;
+       look->surface.data.planar.grad = Background_Pyramid;
        look->surface.data.planar.secondary = color_parse("Yellow");
        look->surface.data.planar.primary = color_parse("Blue");
         look->surface.data.planar.interlaced = FALSE;
This page took 0.027744 seconds and 4 git commands to generate.