FLTK logo

Re: [fltk/fltk] Wayland use of alpha in glClearColor/glClear() -- bug or misfeature? (Issue #957)

FLTK matrix user chat room
(using Element browser app)   FLTK gitter user chat room   GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 All Forums  |  Back to fltk.issues  ]
 
Previous Message ]New Message | Reply ]Next Message ]

Re: [fltk/fltk] Wayland use of alpha in glClearColor/glClear() -- bug or misfeature? (Issue #957) Gonzalo Garramuño 19:26 Apr 21  
 

@ggarra13 Would the attach patch fix the issue?

issue957.patch

No, I'm afraid it would not. That sets the clear color to an alpha of 1.
The code you has two issues. In OpenGL, that color is not applied with that instruction, but only when you do:

glClear(GL_COLOR_BUFFER_BIT);

Even if you add that to your patch, the whole idea is to leave the alpha at 0, like the original code:

glClearColor(0.0, 0.0, 0.0, 0.0);
glClear(GL_COLOR_BUFFER_BIT);

Imagine a PNG drawing of a ball with an alpha channel of 1 where the ball is 1 and 0 where the ball is not present. You want that image to not change when you: 1) load it, 2) display or 3) save it back again after, say, changing its color. For 3) to happen, you need the alpha channel to remain the same all through out. That way you can change the background at any time by doing a "composite". If you are new to compositing, google for it for some samples.

If you call:

glClearColor(0.0, 0.0, 0.0, 1.0);
glClear(GL_COLOR_BUFFER_BIT);

the ball and the background would have an alpha of 1.0, and you would no longer be able to composite the ball on a different background anymore (it would have black hard-coded).

The code we are looking for is NOT OpenGL code, but something in Wayland that clears the window to 0,0,0,0 when it is created, without letting the Desktop background through.


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <fltk/fltk/issues/957/2068371599@github.com>

Direct Link to Message ]
 
     
Previous Message ]New Message | Reply ]Next Message ]
 
 

Comments are owned by the poster. All other content is copyright 1998-2024 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.