From 6f7bc2a7074b7f8c9dacd997d4af597396bbc8d0 Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Tue, 12 Aug 2014 11:45:50 +0200 Subject: [PATCH] Avoid transparency in qopenglwindow example On systems that give alpha configs by default writing alpha values of less than 1.0 is a bad idea since it will lead to the content behind the window becoming visible, even though this is not the example's intention. Change-Id: I23cdfc1fb78d77b1cbc192d2aba5d6665a7acfcc Reviewed-by: Gunnar Sletta --- examples/opengl/qopenglwindow/background.frag | 3 ++- examples/opengl/qopenglwindow/background_renderer.cpp | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/examples/opengl/qopenglwindow/background.frag b/examples/opengl/qopenglwindow/background.frag index 3d9914e64bc..572c941f08b 100644 --- a/examples/opengl/qopenglwindow/background.frag +++ b/examples/opengl/qopenglwindow/background.frag @@ -20,5 +20,6 @@ void main() { highp float coordNoise = noise(gl_FragCoord.xy); highp float proximity = smoothstep(0.5, 1.0, (curv() + 1.0) * (coordNoise )); - gl_FragColor = vec4(coordNoise, coordNoise, coordNoise, 1.0) * proximity; + highp vec3 color = vec3(coordNoise) * proximity; + gl_FragColor = vec4(color, 1.0); } diff --git a/examples/opengl/qopenglwindow/background_renderer.cpp b/examples/opengl/qopenglwindow/background_renderer.cpp index 4c377e14375..2c830ac13c4 100644 --- a/examples/opengl/qopenglwindow/background_renderer.cpp +++ b/examples/opengl/qopenglwindow/background_renderer.cpp @@ -89,7 +89,7 @@ void FragmentToy::draw(const QSize &windowSize) glDisable(GL_STENCIL_TEST); glDisable(GL_DEPTH_TEST); - glClearColor(0,0,0,0); + glClearColor(0, 0, 0, 1); glClear(GL_COLOR_BUFFER_BIT); if (!m_vao.isCreated()) m_vao.create();