[client] egl: create 24-bit colour context

This should prevent the looking-glass-client window from having an alpha
channel. On Wayland, the alpha channel is used to compose the window onto
the desktop, so the wallpaper would bleed through unless set to complete
opaque.

We worked around this by using constant alpha for rendering, but it was
not sustainable. Instead, we should just ask for 24-bit context.
This commit is contained in:
Quantum authored and Geoffrey McRae committed 2021-02-21 10:31:48 +11:00
1 parent 5454053d96
commit 2993f7ae7d
3 files changed
+3 -6

No files matched your search

+1 -1
View File
@@ -518,7 +518,7 @@ bool egl_render_startup(void * opaque)
EGLint attr[] =
{
EGL_BUFFER_SIZE , 32,
EGL_BUFFER_SIZE , 24,
EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT,
EGL_SAMPLE_BUFFERS , maxSamples > 0 ? 1 : 0,
EGL_SAMPLES , maxSamples,
+1 -4
View File
@@ -186,8 +186,7 @@ void egl_help_render(EGL_Help * help, const float scaleX, const float scaleY)
return;
glEnable(GL_BLEND);
glBlendColor(0, 0, 0, 0.5);
glBlendFunc(GL_CONSTANT_ALPHA, GL_ONE_MINUS_CONSTANT_ALPHA);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
// render the background first
egl_shader_use(help->shaderBG);
@@ -195,8 +194,6 @@ void egl_help_render(EGL_Help * help, const float scaleX, const float scaleY)
glUniform2f(help->uSizeBG , help->width, help->height);
egl_model_render(help->model);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
// render the texture over the background
egl_shader_use(help->shader);
glUniform2f(help->uScreen, scaleX , scaleY );
+1 -1
View File
@@ -4,5 +4,5 @@ out highp vec4 color;
void main()
{
color = vec4(0.0, 0.0, 1.0, 1.0);
color = vec4(0.0, 0.0, 1.0, 0.5);
}