diff options
Diffstat (limited to 'include/render/fx_renderer/shaders.h')
-rw-r--r-- | include/render/fx_renderer/shaders.h | 69 |
1 files changed, 69 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..584b18e --- /dev/null +++ b/include/render/fx_renderer/shaders.h @@ -0,0 +1,69 @@ +#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 tex_proj; + GLint tex; + GLint pos_attrib; + GLint half_size; + GLint position; + GLint color; + GLint radius; +}; + +struct box_shadow_shader { + GLuint program; + GLint proj; + GLint tex_proj; + GLint tex; + GLint pos_attrib; + GLint position; + GLint size; + GLint color; + GLint blur_sigma; + GLint corner_radius; +}; + +bool link_shaders(struct fx_renderer *renderer); + +#endif |