1 #ifndef SHADER_blitcolour_H
2 #define SHADER_blitcolour_H
3 static void shader_blitcolour_link(void);
4 static void shader_blitcolour_register(void);
5 static struct vg_shader _shader_blitcolour
= {
7 .link
= shader_blitcolour_link
,
10 .orig_file
= "shaders/blit.vs",
12 "layout (location=0) in vec2 a_co;\n"
15 "uniform vec2 uInverseRatio;\n"
19 " gl_Position = vec4(a_co*2.0-1.0,0.0,1.0);\n"
20 " aUv = a_co * uInverseRatio;\n"
25 .orig_file
= "shaders/colour.fs",
27 "out vec4 FragColor;\n"
28 "uniform vec4 uColour;\n"
34 " FragColor = uColour;\n"
39 static GLuint _uniform_blitcolour_uInverseRatio
;
40 static GLuint _uniform_blitcolour_uColour
;
41 static void shader_blitcolour_uInverseRatio(v2f v
){
42 glUniform2fv(_uniform_blitcolour_uInverseRatio
,1,v
);
44 static void shader_blitcolour_uColour(v4f v
){
45 glUniform4fv(_uniform_blitcolour_uColour
,1,v
);
47 static void shader_blitcolour_register(void){
48 vg_shader_register( &_shader_blitcolour
);
50 static void shader_blitcolour_use(void){ glUseProgram(_shader_blitcolour
.id
); }
51 static void shader_blitcolour_link(void){
52 _uniform_blitcolour_uInverseRatio
= glGetUniformLocation( _shader_blitcolour
.id
, "uInverseRatio" );
53 _uniform_blitcolour_uColour
= glGetUniformLocation( _shader_blitcolour
.id
, "uColour" );
55 #endif /* SHADER_blitcolour_H */