summaryrefslogtreecommitdiff
path: root/include/sway
diff options
context:
space:
mode:
authorErik Reider <[email protected]>2023-06-03 00:53:41 +0200
committerGitHub <[email protected]>2023-06-02 18:53:41 -0400
commit212c51f62cc06885606879fe2deca207d6fd6a60 (patch)
tree023982a8e26972aa798cd05cc82ecc3afb537ddc /include/sway
parent22327ef300a60294e8a1bc847aac4d4576d3f6c6 (diff)
fix: update stencil if the output size changes (#178)
Diffstat (limited to 'include/sway')
-rw-r--r--include/sway/desktop/fx_renderer/fx_framebuffer.h6
-rw-r--r--include/sway/desktop/fx_renderer/fx_stencilbuffer.h18
-rw-r--r--include/sway/desktop/fx_renderer/fx_texture.h6
3 files changed, 26 insertions, 4 deletions
diff --git a/include/sway/desktop/fx_renderer/fx_framebuffer.h b/include/sway/desktop/fx_renderer/fx_framebuffer.h
index 39eeb257..3372cd00 100644
--- a/include/sway/desktop/fx_renderer/fx_framebuffer.h
+++ b/include/sway/desktop/fx_renderer/fx_framebuffer.h
@@ -5,12 +5,13 @@
#include <stdbool.h>
#include <wlr/types/wlr_output.h>
+#include "sway/desktop/fx_renderer/fx_stencilbuffer.h"
#include "sway/desktop/fx_renderer/fx_texture.h"
struct fx_framebuffer {
- struct fx_texture texture;
GLuint fb;
- GLuint stencil_buffer;
+ struct fx_stencilbuffer stencil_buffer;
+ struct fx_texture texture;
};
struct fx_framebuffer fx_framebuffer_create();
@@ -23,5 +24,4 @@ void fx_framebuffer_add_stencil_buffer(struct fx_framebuffer *buffer, int width,
void fx_framebuffer_release(struct fx_framebuffer *buffer);
-
#endif
diff --git a/include/sway/desktop/fx_renderer/fx_stencilbuffer.h b/include/sway/desktop/fx_renderer/fx_stencilbuffer.h
new file mode 100644
index 00000000..157c0282
--- /dev/null
+++ b/include/sway/desktop/fx_renderer/fx_stencilbuffer.h
@@ -0,0 +1,18 @@
+#ifndef FX_STENCILBUFFER_H
+#define FX_STENCILBUFFER_H
+
+#include <GLES2/gl2.h>
+#include <stdbool.h>
+#include <wlr/render/wlr_texture.h>
+
+struct fx_stencilbuffer {
+ GLuint rb;
+ int width;
+ int height;
+};
+
+struct fx_stencilbuffer fx_stencilbuffer_create();
+
+void fx_stencilbuffer_release(struct fx_stencilbuffer *stencil_buffer);
+
+#endif
diff --git a/include/sway/desktop/fx_renderer/fx_texture.h b/include/sway/desktop/fx_renderer/fx_texture.h
index 0c375913..62e635e6 100644
--- a/include/sway/desktop/fx_renderer/fx_texture.h
+++ b/include/sway/desktop/fx_renderer/fx_texture.h
@@ -13,6 +13,10 @@ struct fx_texture {
int height;
};
-struct fx_texture fx_texture_from_wlr_texture(struct wlr_texture* tex);
+struct fx_texture fx_texture_create();
+
+struct fx_texture fx_texture_from_wlr_texture(struct wlr_texture *tex);
+
+void fx_texture_release(struct fx_texture *texture);
#endif