diff options
-rw-r--r-- | README.md | 2 | ||||
-rw-r--r-- | window_texture.c | 8 |
2 files changed, 6 insertions, 4 deletions
@@ -1,7 +1,7 @@ Utility to get the opengl texture associated with a x11 window ## Note -Might now work when using a compositor such as picom when using the glx backend. +Might now work when using a compositor such as picom when using the glx backend. Use the egl version (https://git.dec05eba.com/window-texture-egl/about/) instead which doesn't have this limitation. # Dependencies glx (a library such as libglvnd), x11, xcomposite diff --git a/window_texture.c b/window_texture.c index 7d5d4b9..ccd8947 100644 --- a/window_texture.c +++ b/window_texture.c @@ -152,9 +152,11 @@ int window_texture_on_resize(WindowTexture *self) { glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR ); glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR ); + /* float fLargest = 0.0f; glGetFloatv(GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT, &fLargest); glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, fLargest); + */ glBindTexture(GL_TEXTURE_2D, 0); @@ -167,9 +169,9 @@ int window_texture_on_resize(WindowTexture *self) { cleanup: if(texture_id != 0) glDeleteTextures(1, &texture_id); - if(glx_pixmap) glXDestroyPixmap(self->display, self->glx_pixmap); - if(glx_pixmap_bound) glXReleaseTexImageEXT(self->display, self->glx_pixmap, GLX_FRONT_EXT); - if(pixmap) XFreePixmap(self->display, self->pixmap); + if(glx_pixmap) glXDestroyPixmap(self->display, glx_pixmap); + if(glx_pixmap_bound) glXReleaseTexImageEXT(self->display, glx_pixmap, GLX_FRONT_EXT); + if(pixmap) XFreePixmap(self->display, pixmap); if(configs) XFree(configs); return result; } |