1 #ifndef SHADER_routeui_H
2 #define SHADER_routeui_H
3 static void shader_routeui_link(void);
4 static void shader_routeui_register(void);
5 static struct vg_shader _shader_routeui
= {
7 .link
= shader_routeui_link
,
10 .orig_file
= "shaders/routeui.vs",
12 "layout (location=0) in vec2 a_co;\n"
14 "uniform vec4 uOffset;\n"
18 " vec2 vpos = a_co * uOffset.zw + uOffset.xy;\n"
19 " gl_Position = vec4(vpos,0.0,1.0);\n"
24 .orig_file
= "shaders/routeui.fs",
26 "out vec4 FragColor;\n"
28 "uniform vec4 uColour;\n"
32 " FragColor = uColour;\n"
37 static GLuint _uniform_routeui_uOffset
;
38 static GLuint _uniform_routeui_uColour
;
39 static void shader_routeui_uOffset(v4f v
){
40 glUniform4fv(_uniform_routeui_uOffset
,1,v
);
42 static void shader_routeui_uColour(v4f v
){
43 glUniform4fv(_uniform_routeui_uColour
,1,v
);
45 static void shader_routeui_register(void){
46 vg_shader_register( &_shader_routeui
);
48 static void shader_routeui_use(void){ glUseProgram(_shader_routeui
.id
); }
49 static void shader_routeui_link(void){
50 _uniform_routeui_uOffset
= glGetUniformLocation( _shader_routeui
.id
, "uOffset" );
51 _uniform_routeui_uColour
= glGetUniformLocation( _shader_routeui
.id
, "uColour" );
53 #endif /* SHADER_routeui_H */