summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorRobert Bragg <robert@linux.intel.com>2011-07-15 12:31:21 +0100
committerRobert Bragg <robert@linux.intel.com>2011-07-18 16:49:07 +0100
commitdb7f0879531ba397b2091640f7f39d4468544f9a (patch)
tree2768cd33a3974ea44ceb60ff7b81b5c203a24acf /examples
parent6d79657f76fb0df4c15b6a5ec63156b0f9596ac7 (diff)
downloadcogl-db7f0879531ba397b2091640f7f39d4468544f9a.tar.gz
hello: Make sure to clear background explicitly
This test wasn't actually explicitly clearing the background to black it was simply a fluke that some drivers clear the background when allocating a new framebuffer. Reviewed-by: Neil Roberts <neil@linux.intel.com>
Diffstat (limited to 'examples')
-rw-r--r--examples/hello.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/examples/hello.c b/examples/hello.c
index 079dc4ec..775cc1aa 100644
--- a/examples/hello.c
+++ b/examples/hello.c
@@ -2,6 +2,8 @@
#include <glib.h>
#include <stdio.h>
+CoglColor black;
+
int
main (int argc, char **argv)
{
@@ -38,6 +40,7 @@ main (int argc, char **argv)
triangle = cogl_primitive_new_p2c4 (COGL_VERTICES_MODE_TRIANGLES,
3, triangle_vertices);
for (;;) {
+ cogl_clear (&black, COGL_BUFFER_BIT_COLOR);
cogl_primitive_draw (triangle);
cogl_framebuffer_swap_buffers (fb);
}