diff options
author | Laszlo Agocs <laszlo.agocs@digia.com> | 2014-08-12 11:45:50 +0200 |
---|---|---|
committer | Laszlo Agocs <laszlo.agocs@digia.com> | 2014-08-14 11:02:45 +0200 |
commit | 6f7bc2a7074b7f8c9dacd997d4af597396bbc8d0 (patch) | |
tree | 8f5033a1e65f27f45c6640028acc4a6e2a2ec352 /examples | |
parent | 0b153bc93a9a954222fadce54da89476900b3f32 (diff) |
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 <gunnar.sletta@jollamobile.com>
Diffstat (limited to 'examples')
-rw-r--r-- | examples/opengl/qopenglwindow/background.frag | 3 | ||||
-rw-r--r-- | 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 3d9914e64b..572c941f08 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 4c377e1437..2c830ac13c 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(); |