rust-windowing/glutin

Example not transparent anymore

Closed this issue · 2 comments

eEQK commented

I'm running the window example with cargo clean && cargo run --example window

The resulting window should be transparent, but is not

bisect says the change was introduced in 8212176 (in other words previous commit did support transparency and to me it looks like the window not being transparent isn't an intended behavior)

image

Only change I've added:

diff --git a/glutin_examples/src/lib.rs b/glutin_examples/src/lib.rs
index b3e2581..0c68b66 100644
--- a/glutin_examples/src/lib.rs
+++ b/glutin_examples/src/lib.rs
@@ -283,7 +283,7 @@ impl Renderer {
             self.gl.BindVertexArray(self.vao);
             self.gl.BindBuffer(gl::ARRAY_BUFFER, self.vbo);

-            self.gl.ClearColor(0.1, 0.1, 0.1, 0.9);
+            self.gl.ClearColor(0.1, 0.1, 0.1, 0.2);
             self.gl.Clear(gl::COLOR_BUFFER_BIT);
             self.gl.DrawArrays(gl::TRIANGLES, 0, 3);

Log with versions:

Running on Apple M1 Max
OpenGL Version 4.1 Metal - 76.3
Shaders version on 4.10

my device: macOS 12.3.1, MBP 2021 14'

Are you using native OpenGL impl? It's kind of strange that you have metal logged here as well.

Though, I'd guess some config option is missing now. So it's working, but likely not enabled... Should be trivial to fix in the example code.

eEQK commented

I've raised a PR with the fix

I thought the problem was more complicated, turns out I was just looking in the wrong place 🤦