Fix resize to fullscreen black video

This commit is contained in:
dec05eba 2022-03-22 15:57:29 +01:00
parent 76dc50e862
commit af2a211767

View File

@ -242,9 +242,6 @@ static bool recreate_window_pixmap(Display *dpy, Window window_id,
// glEnable(GL_BLEND); // glEnable(GL_BLEND);
// glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); // glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
pixmap.texture_width = attr.width;
pixmap.texture_height = attr.height;
glXBindTexImageEXT(dpy, pixmap.glx_pixmap, GLX_FRONT_EXT, NULL); glXBindTexImageEXT(dpy, pixmap.glx_pixmap, GLX_FRONT_EXT, NULL);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER,
GL_NEAREST); // GL_LINEAR ); GL_NEAREST); // GL_LINEAR );
@ -252,9 +249,14 @@ static bool recreate_window_pixmap(Display *dpy, Window window_id,
GL_NEAREST); // GL_LINEAR);//GL_LINEAR_MIPMAP_LINEAR ); GL_NEAREST); // GL_LINEAR);//GL_LINEAR_MIPMAP_LINEAR );
//glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); //glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
GLint gl_texture_width = 0; glGetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_WIDTH,
glGetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_WIDTH, &gl_texture_width); &pixmap.texture_width);
if(gl_texture_width == 0) { glGetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_HEIGHT,
&pixmap.texture_height);
if(pixmap.texture_width == 0 || pixmap.texture_height == 0) {
pixmap.texture_width = attr.width;
pixmap.texture_height = attr.height;
fprintf(stderr, "Warning: failed to get texture size. You are probably running an unsupported compositor and recording the selected window doesn't work at the moment. A black window will be displayed instead\n"); fprintf(stderr, "Warning: failed to get texture size. You are probably running an unsupported compositor and recording the selected window doesn't work at the moment. A black window will be displayed instead\n");
} }