[cogl] hello: Make sure to clear background explicitly
- From: Robert Bragg <rbragg src gnome org>
 
- To: commits-list gnome org
 
- Cc: 
 
- Subject: [cogl] hello: Make sure to clear background explicitly
 
- Date: Mon, 18 Jul 2011 16:10:32 +0000 (UTC)
 
commit db7f0879531ba397b2091640f7f39d4468544f9a
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.
    
    Reviewed-by: Neil Roberts <neil linux intel com>
 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]