From 78ad57a36ad69a9c22874b182d49d64125c380f2 Mon Sep 17 00:00:00 2001 From: Yannis Guyon Date: Wed, 18 Jul 2018 10:36:19 +0200 Subject: [PATCH] Fix bad glClearColor parameters Container spec indicates that background color is written in BGRA byte order, but glClearColor() parameters are RGBA. Anyway the checkerboard is displayed right after glClear() calls so it replaces background color. In response to webp-discuss/TkLHALGaHaM Change-Id: Ief5435fadfd6a422b881a9dc240b5e8dc6546e19 --- examples/vwebp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/vwebp.c b/examples/vwebp.c index f3f16474..80d930c3 100644 --- a/examples/vwebp.c +++ b/examples/vwebp.c @@ -408,9 +408,9 @@ static void StartDisplay(void) { glutKeyboardFunc(HandleKey); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glEnable(GL_BLEND); - glClearColor(GetColorf(kParams.bg_color, 0), + glClearColor(GetColorf(kParams.bg_color, 16), // BGRA from spec GetColorf(kParams.bg_color, 8), - GetColorf(kParams.bg_color, 16), + GetColorf(kParams.bg_color, 0), GetColorf(kParams.bg_color, 24)); glClear(GL_COLOR_BUFFER_BIT); DrawCheckerBoard();