diff options
Diffstat (limited to 'include/shader.h')
-rw-r--r-- | include/shader.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/include/shader.h b/include/shader.h new file mode 100644 index 0000000..37f4c09 --- /dev/null +++ b/include/shader.h @@ -0,0 +1,19 @@ +#ifndef GSR_SHADER_H +#define GSR_SHADER_H + +#include "egl.h" + +typedef struct { + gsr_egl *egl; + unsigned int program_id; +} gsr_shader; + +/* |vertex_shader| or |fragment_shader| may be NULL */ +int gsr_shader_init(gsr_shader *self, gsr_egl *egl, const char *vertex_shader, const char *fragment_shader); +void gsr_shader_deinit(gsr_shader *self); + +int gsr_shader_bind_attribute_location(gsr_shader *self, const char *attribute, int location); +void gsr_shader_use(gsr_shader *self); +void gsr_shader_use_none(gsr_shader *self); + +#endif /* GSR_SHADER_H */ |