diff options
author | Erik Reider <[email protected]> | 2024-01-06 02:31:14 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2024-01-06 02:31:14 +0100 |
commit | 6759e8da7ab53a46b0eb04e5045b8c67262c3a11 (patch) | |
tree | c65ed83ca04b61bdbae7e1b8a7f2c16f29b89730 /include/render/fx_renderer/shaders.h | |
parent | b929a2bbadf467864796ad4ec90882ce86cfebff (diff) | |
parent | ace97585b2b4d8cbb5ead6cd0f72fa8e8889c9d7 (diff) |
Merge pull request #24 from wlrfx/wlroots-0.17-rebase
Rebase to wlroots 0.17
Diffstat (limited to 'include/render/fx_renderer/shaders.h')
-rw-r--r-- | include/render/fx_renderer/shaders.h | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/include/render/fx_renderer/shaders.h b/include/render/fx_renderer/shaders.h new file mode 100644 index 0000000..92a14d5 --- /dev/null +++ b/include/render/fx_renderer/shaders.h @@ -0,0 +1,65 @@ +#ifndef _FX_SHADERS_H +#define _FX_SHADERS_H + +#include <GLES2/gl2.h> +#include <stdbool.h> + +struct fx_renderer; + +GLuint compile_shader(GLuint type, const GLchar *src); + +GLuint link_program(const GLchar *frag_src); + +bool check_gl_ext(const char *exts, const char *ext); + +void load_gl_proc(void *proc_ptr, const char *name); + +enum fx_tex_shader_source { + SHADER_SOURCE_TEXTURE_RGBA = 1, + SHADER_SOURCE_TEXTURE_RGBX = 2, + SHADER_SOURCE_TEXTURE_EXTERNAL = 3, +}; + +struct quad_shader { + GLuint program; + GLint proj; + GLint color; + GLint pos_attrib; +}; + +struct tex_shader { + GLuint program; + GLint proj; + GLint tex_proj; + GLint tex; + GLint alpha; + GLint pos_attrib; + GLint size; + GLint position; + GLint radius; +}; + +struct stencil_mask_shader { + GLuint program; + GLint proj; + GLint color; + GLint pos_attrib; + GLint half_size; + GLint position; + GLint radius; +}; + +struct box_shadow_shader { + GLuint program; + GLint proj; + GLint color; + GLint pos_attrib; + GLint position; + GLint size; + GLint blur_sigma; + GLint corner_radius; +}; + +bool link_shaders(struct fx_renderer *renderer); + +#endif |