aboutsummaryrefslogtreecommitdiff
path: root/src/egl.c
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2025-03-13 01:38:26 +0100
committerdec05eba <dec05eba@protonmail.com>2025-03-13 01:38:26 +0100
commitaf5468410376f6b8cb3a0c6e3fb46636e03299f8 (patch)
treed43bc60461ae593831f3e717bb74266315441c55 /src/egl.c
parent92492db788e97db028176c942e9aed047f8f152a (diff)
Fix screenshot with region not working correctly for some sizes and possibly crashing
Diffstat (limited to 'src/egl.c')
-rw-r--r--src/egl.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/egl.c b/src/egl.c
index d2832f4..3307f0f 100644
--- a/src/egl.c
+++ b/src/egl.c
@@ -324,6 +324,7 @@ static bool gsr_egl_load_gl(gsr_egl *self, void *library) {
{ (void**)&self->glEnable, "glEnable" },
{ (void**)&self->glDisable, "glDisable" },
{ (void**)&self->glBlendFunc, "glBlendFunc" },
+ { (void**)&self->glPixelStorei, "glPixelStorei" },
{ (void**)&self->glGetUniformLocation, "glGetUniformLocation" },
{ (void**)&self->glUniform1f, "glUniform1f" },
{ (void**)&self->glUniform2f, "glUniform2f" },
@@ -448,6 +449,8 @@ bool gsr_egl_load(gsr_egl *self, gsr_window *window, bool is_monitor_capture, bo
self->glEnable(GL_BLEND);
self->glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
+ self->glPixelStorei(GL_PACK_ALIGNMENT, 1);
+ self->glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
if(enable_debug) {
self->glEnable(GL_DEBUG_OUTPUT);