NGL  6.5
The NCCA Graphics Library
TextShaders.h
Go to the documentation of this file.
1 #ifndef TEXTSHADERS_H_
2 #define TEXTSHADERS_H_
3 #include <string>
4 
6 R"DELIM(
7 #version 150
8 in vec2 inVert;
9 in vec2 inUV;
10 out vec2 vertUV;
11 uniform vec3 textColour;
12 uniform float scaleX;
13 uniform float scaleY;
14 uniform float xpos;
15 uniform float ypos;
16 void main()
17 {
18  vertUV=inUV;
19  gl_Position=vec4( ((xpos+inVert.x)*scaleX)-1.0,((ypos+inVert.y)*scaleY)+1.0,0.0,1.0);
20 }
21 )DELIM";
22 
23 
24 
25 
27 R"DELIM(
28 #version 150
29 uniform sampler2D tex;
30 in vec2 vertUV;
31 out vec4 fragColour;
32 uniform vec3 textColour;
33 void main()
34 {
35  vec4 text=texture(tex,vertUV.st);
36  fragColour.rgb=textColour.rgb;
37  fragColour.a=text.a;
38 }
39 )DELIM";
40 
41 #endif
42 
const std::string textFragmentShader
Definition: TextShaders.h:26
const std::string textVertexShader
Definition: TextShaders.h:5
GLsizei const GLchar *const * string
Definition: glew.h:1847