]> Dogcows Code - chaz/openbox/blobdiff - render/gradient.c
remove debug print
[chaz/openbox] / render / gradient.c
index ce066b21046662b60d820c16681a8a6053c301de..31d4c73034eb65a230b72fae283ee3e676e9d670 100644 (file)
@@ -1,4 +1,6 @@
+#ifdef USE_GL
 #include <GL/gl.h>
+#endif /* USE_GL */
 #include <glib.h>
 #include "render.h"
 #include "gradient.h"
@@ -621,7 +623,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);
This page took 0.024843 seconds and 4 git commands to generate.