{
float pr,pg,pb;
float sr, sg, sb;
+ float ar, ag, ab;
pr = (float)sf->data.planar.primary->r/255.0;
pg = (float)sf->data.planar.primary->g/255.0;
glVertex3i(x, y, 0);
glEnd();
return;
- case Background_Vertical:
+ case Background_Horizontal:
glBegin(GL_TRIANGLES);
glColor3f(pr, pg, pb);
glVertex3i(x, y, 0);
glVertex3i(x, y, 0);
glEnd();
break;
- case Background_Horizontal:
+ case Background_Vertical:
glBegin(GL_TRIANGLES);
glColor3f(pr, pg, pb);
glVertex3i(x, y, 0);
glEnd();
break;
case Background_Diagonal:
-printf("diagonal\n");
+ ar = (pr + sr) / 2.0;
+ ag = (pg + sg) / 2.0;
+ ab = (pb + sb) / 2.0;
+ glBegin(GL_TRIANGLES);
+ glColor3f(ar, ag, ab);
+ glVertex3i(x, y, 0);
+ glColor3f(pr, pg, pb);
+ glVertex3i(x+w, y, 0);
+ glColor3f(ar, ag, ab);
+ glVertex3i(x+w, y+h, 0);
+
+ glColor3f(ar, ag, ab);
+ glVertex3i(x+w, y+h, 0);
+ glColor3f(sr, sg, sb);
+ glVertex3i(x, y+h, 0);
+ glColor3f(ar, ag, ab);
+ glVertex3i(x, y, 0);
+ glEnd();
break;
case Background_CrossDiagonal:
-printf("crossdiagonal\n");
+ ar = (pr + sr) / 2.0;
+ ag = (pg + sg) / 2.0;
+ ab = (pb + sb) / 2.0;
+ glBegin(GL_TRIANGLES);
+ glColor3f(pr, pg, pb);
+ glVertex3i(x, y, 0);
+ glColor3f(ar, ag, ab);
+ glVertex3i(x+w, y, 0);
+ glColor3f(sr, sg, sb);
+ glVertex3i(x+w, y+h, 0);
+
+ glColor3f(sr, sg, sb);
+ glVertex3i(x+w, y+h, 0);
+ glColor3f(ar, ag, ab);
+ glVertex3i(x, y+h, 0);
+ glColor3f(pr, pg, pb);
+ glVertex3i(x, y, 0);
+ glEnd();
break;
case Background_Pyramid:
printf("pyramid\n");
break;
case Background_PipeCross:
-printf("pipecross\n");
break;
case Background_Rectangle:
-printf("rect\n");
+ glBegin(GL_TRIANGLES);
+ glColor3f(pr, pg, pb);
+ glVertex3i(x, y, 0);
+ glColor3f(sr, sg, sb);
+ glVertex3i(x+w/2, y+h/2, 0);
+ glColor3f(pr, pg, pb);
+ glVertex3i(x, y+h, 0);
+
+ glVertex3i(x, y+h, 0);
+ glColor3f(sr, sg, sb);
+ glVertex3i(x+w/2, y+h/2, 0);
+ glColor3f(pr, pg, pb);
+ glVertex3i(x+w, y+h, 0);
+
+ glVertex3i(x+w, y+h, 0);
+ glColor3f(sr, sg, sb);
+ glVertex3i(x+w/2, y+h/2, 0);
+ glColor3f(pr, pg, pb);
+ glVertex3i(x+w, y, 0);
+
+ glVertex3i(x+w, y, 0);
+ glColor3f(sr, sg, sb);
+ glVertex3i(x+w/2, y+h/2, 0);
+ glColor3f(pr, pg, pb);
+ glVertex3i(x, y, 0);
+
+ glEnd();
break;
default:
g_message("unhandled gradient");
render_startup();
look = appearance_new(Surface_Planar, 0);
- look->surface.data.planar.grad = Background_Horizontal;
- look->surface.data.planar.secondary = color_new(0xFF, 0xFF, 0xFF);
- look->surface.data.planar.primary = color_parse("Black");
+ look->surface.data.planar.grad = Background_Rectangle;
+ look->surface.data.planar.secondary = color_parse("Yellow");
+ look->surface.data.planar.primary = color_parse("Blue");
look->surface.data.planar.interlaced = FALSE;
look->area.x = 0;
look->area.y = 0;