[cogl/wip/rib/master-next: 5/5] hello: Make sure to clear background explicitly



commit 478ff4fc457fc2ef640a1e8d0b510c27fbbcf8c1
Author: Robert Bragg <robert linux intel com>
Date:   Fri Jul 15 12:31:21 2011 +0100

    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.

 examples/hello.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
---
diff --git a/examples/hello.c b/examples/hello.c
index 079dc4e..775cc1a 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);
     }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]