summaryrefslogtreecommitdiff
path: root/sway/desktop/fx_renderer/fx_stencilbuffer.c
blob: 5b99ff798aef098f0ed417a9aba312609b2455fd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include <assert.h>
#include <wlr/render/gles2.h>

#include "sway/desktop/fx_renderer/fx_stencilbuffer.h"

struct fx_stencilbuffer fx_stencilbuffer_create() {
	return (struct fx_stencilbuffer) {
		.rb = -1,
		.width = -1,
		.height = -1,
	};
}

void fx_stencilbuffer_release(struct fx_stencilbuffer *stencil_buffer) {
	if (stencil_buffer->rb != (uint32_t) -1 && stencil_buffer->rb) {
		glDeleteRenderbuffers(1, &stencil_buffer->rb);
	}
	stencil_buffer->rb = -1;
	stencil_buffer->width = -1;
	stencil_buffer->height = -1;
}