aboutsummaryrefslogtreecommitdiff
path: root/include/shader.h
blob: 57d1096d6d3522de51eff188b677f2c12f67a1dd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#ifndef GSR_SHADER_H
#define GSR_SHADER_H

typedef struct gsr_egl gsr_egl;

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 */