summaryrefslogtreecommitdiffstats
path: root/gears.c
diff options
context:
space:
mode:
authorKristian Høgsberg <krh@redhat.com>2008-11-08 15:06:01 -0500
committerKristian Høgsberg <krh@redhat.com>2008-11-08 15:06:01 -0500
commit78231c8dd0f16e2a64e16691b1137834062e78d9 (patch)
treec03676fa036780090e535b4fe8cca53771d71179 /gears.c
parent1cbaa6abacfef875ace3d35166f8dc04f4347601 (diff)
downloadwayland-78231c8dd0f16e2a64e16691b1137834062e78d9.tar.gz
wayland-78231c8dd0f16e2a64e16691b1137834062e78d9.tar.xz
wayland-78231c8dd0f16e2a64e16691b1137834062e78d9.zip
Implement surface copy request, use it for egl gears.
Diffstat (limited to 'gears.c')
-rw-r--r--gears.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/gears.c b/gears.c
index 9722eef..6179ac7 100644
--- a/gears.c
+++ b/gears.c
@@ -125,7 +125,8 @@ gear(GLfloat inner_radius, GLfloat outer_radius, GLfloat width,
}
struct gears *
-gears_create(void)
+gears_create(GLfloat clear_red, GLfloat clear_green,
+ GLfloat clear_blue, GLfloat clear_alpha)
{
static GLfloat red[4] = {0.8, 0.1, 0.0, 1.0};
static GLfloat green[4] = {0.0, 0.8, 0.2, 1.0};
@@ -166,6 +167,14 @@ gears_create(void)
glEnable(GL_LIGHT0);
glEnable(GL_DEPTH_TEST);
+ /* We're generating premultiplied alpha so multiply in the
+ * alpha. The gears are solid color and doesn't have
+ * anti-aliased edges, they're ok. */
+ glClearColor(clear_red * clear_alpha,
+ clear_green * clear_alpha,
+ clear_blue * clear_alpha,
+ clear_alpha);
+
return gears;
}
@@ -174,7 +183,7 @@ gears_draw(struct gears *gears, GLfloat angle)
{
GLfloat view_rotx = 20.0, view_roty = 30.0, view_rotz = 0.0;
- glClear(GL_DEPTH_BUFFER_BIT);
+ glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glPushMatrix();