From 08b0d2d63ed400955b865ad4a205d2fff74e6cc6 Mon Sep 17 00:00:00 2001 From: Neil Roberts Date: Fri, 19 Apr 2013 17:55:29 +0100 Subject: [PATCH] examples: Fix the first colour in the triangle_vertices The first vertex in the triangle vertices used in the cogl-hello example (which were copied into a few other examples) for some reason has a semi-transparent alpha component. However the colour needs to be pre-multiplied and the red component was still 0xff so the colour is effectively invalid and the transparency isn't shown. This patch just sets the alpha component to 0xff to make it less confusing. Reviewed-by: Robert Bragg (cherry picked from commit 461879986ec012556b4e680b73e36d440927faaa) --- examples/android/hello/jni/main.c | 2 +- examples/cogl-gles2-context.c | 2 +- examples/cogl-hello.c | 2 +- examples/cogl-msaa.c | 2 +- examples/cogl-sdl-hello.c | 2 +- examples/cogl-sdl2-hello.c | 2 +- examples/cogl-x11-foreign.c | 2 +- examples/cogland.c | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/examples/android/hello/jni/main.c b/examples/android/hello/jni/main.c index 2c5bd9b43..c9a84018c 100644 --- a/examples/android/hello/jni/main.c +++ b/examples/android/hello/jni/main.c @@ -42,7 +42,7 @@ static int test_init (TestData* data) CoglOnscreen *onscreen; CoglError *error = NULL; CoglVertexP2C4 triangle_vertices[] = { - {0, 0.7, 0xff, 0x00, 0x00, 0x80}, + {0, 0.7, 0xff, 0x00, 0x00, 0xff}, {-0.7, -0.7, 0x00, 0xff, 0x00, 0xff}, {0.7, -0.7, 0x00, 0x00, 0xff, 0xff} }; diff --git a/examples/cogl-gles2-context.c b/examples/cogl-gles2-context.c index 1cf375fad..de66c2118 100644 --- a/examples/cogl-gles2-context.c +++ b/examples/cogl-gles2-context.c @@ -70,7 +70,7 @@ main (int argc, char **argv) CoglOnscreen *onscreen; CoglError *error = NULL; CoglVertexP2C4 triangle_vertices[] = { - {0, 0.7, 0xff, 0x00, 0x00, 0x80}, + {0, 0.7, 0xff, 0x00, 0x00, 0xff}, {-0.7, -0.7, 0x00, 0xff, 0x00, 0xff}, {0.7, -0.7, 0x00, 0x00, 0xff, 0xff} }; diff --git a/examples/cogl-hello.c b/examples/cogl-hello.c index 5bda9bf7e..3ba1e31c4 100644 --- a/examples/cogl-hello.c +++ b/examples/cogl-hello.c @@ -39,7 +39,7 @@ main (int argc, char **argv) CoglOnscreen *onscreen; CoglError *error = NULL; CoglVertexP2C4 triangle_vertices[] = { - {0, 0.7, 0xff, 0x00, 0x00, 0x80}, + {0, 0.7, 0xff, 0x00, 0x00, 0xff}, {-0.7, -0.7, 0x00, 0xff, 0x00, 0xff}, {0.7, -0.7, 0x00, 0x00, 0xff, 0xff} }; diff --git a/examples/cogl-msaa.c b/examples/cogl-msaa.c index 73f9c4e2e..4a388bc7d 100644 --- a/examples/cogl-msaa.c +++ b/examples/cogl-msaa.c @@ -12,7 +12,7 @@ main (int argc, char **argv) CoglFramebuffer *fb; CoglError *error = NULL; CoglVertexP2C4 triangle_vertices[] = { - {0, 0.7, 0xff, 0x00, 0x00, 0x80}, + {0, 0.7, 0xff, 0x00, 0x00, 0xff}, {-0.7, -0.7, 0x00, 0xff, 0x00, 0xff}, {0.7, -0.7, 0x00, 0x00, 0xff, 0xff} }; diff --git a/examples/cogl-sdl-hello.c b/examples/cogl-sdl-hello.c index 961137aef..acb9125aa 100644 --- a/examples/cogl-sdl-hello.c +++ b/examples/cogl-sdl-hello.c @@ -80,7 +80,7 @@ main (int argc, char **argv) CoglOnscreen *onscreen; CoglError *error = NULL; CoglVertexP2C4 triangle_vertices[] = { - {0, 0.7, 0xff, 0x00, 0x00, 0x80}, + {0, 0.7, 0xff, 0x00, 0x00, 0xff}, {-0.7, -0.7, 0x00, 0xff, 0x00, 0xff}, {0.7, -0.7, 0x00, 0x00, 0xff, 0xff} }; diff --git a/examples/cogl-sdl2-hello.c b/examples/cogl-sdl2-hello.c index 405cb92dd..12e6ced29 100644 --- a/examples/cogl-sdl2-hello.c +++ b/examples/cogl-sdl2-hello.c @@ -89,7 +89,7 @@ main (int argc, char **argv) CoglOnscreen *onscreen; CoglError *error = NULL; CoglVertexP2C4 triangle_vertices[] = { - {0, 0.7, 0xff, 0x00, 0x00, 0x80}, + {0, 0.7, 0xff, 0x00, 0x00, 0xff}, {-0.7, -0.7, 0x00, 0xff, 0x00, 0xff}, {0.7, -0.7, 0x00, 0x00, 0xff, 0xff} }; diff --git a/examples/cogl-x11-foreign.c b/examples/cogl-x11-foreign.c index ca9e3ed7d..a60397cd4 100644 --- a/examples/cogl-x11-foreign.c +++ b/examples/cogl-x11-foreign.c @@ -61,7 +61,7 @@ main (int argc, char **argv) unsigned long mask; Window xwin; CoglVertexP2C4 triangle_vertices[] = { - {0, 0.7, 0xff, 0x00, 0x00, 0x80}, + {0, 0.7, 0xff, 0x00, 0x00, 0xff}, {-0.7, -0.7, 0x00, 0xff, 0x00, 0xff}, {0.7, -0.7, 0x00, 0x00, 0xff, 0xff} }; diff --git a/examples/cogland.c b/examples/cogland.c index ab4f3c181..7a027197a 100644 --- a/examples/cogland.c +++ b/examples/cogland.c @@ -1056,7 +1056,7 @@ main (int argc, char **argv) CoglError *error = NULL; GError *gerror = NULL; CoglVertexP2C4 triangle_vertices[] = { - {0, 0.7, 0xff, 0x00, 0x00, 0x80}, + {0, 0.7, 0xff, 0x00, 0x00, 0xff}, {-0.7, -0.7, 0x00, 0xff, 0x00, 0xff}, {0.7, -0.7, 0x00, 0x00, 0xff, 0xff} };