swayfx/include/sway/desktop/fx_renderer/fx_framebuffer.h
Erik Reider acafb20b11
Move stencil into each framebuffer (#156)
* Move stencil into each framebuffer

Also fixes the stencil being added to the wrong framebuffer

* Initialize texture members on framebuffer init

* removed bind arg

* renamed init to create, changed existing create to update

* moved stencil buffer creation to new function

* removed some now misleading comments

---------

Co-authored-by: William McKinnon <contact@willmckinnon.com>
2023-05-17 19:39:48 -04:00

28 lines
625 B
C

#ifndef FX_FRAMEBUFFER_H
#define FX_FRAMEBUFFER_H
#include <GLES2/gl2.h>
#include <stdbool.h>
#include <wlr/types/wlr_output.h>
#include "sway/desktop/fx_renderer/fx_texture.h"
struct fx_framebuffer {
struct fx_texture texture;
GLuint fb;
GLuint stencil_buffer;
};
struct fx_framebuffer fx_framebuffer_create();
void fx_framebuffer_bind(struct fx_framebuffer *buffer);
void fx_framebuffer_update(struct fx_framebuffer *buffer, int width, int height);
void fx_framebuffer_add_stencil_buffer(struct fx_framebuffer *buffer, int width, int height);
void fx_framebuffer_release(struct fx_framebuffer *buffer);
#endif