BLF/OpenGL: draw text with new immediate mode

Part of T49043
This commit is contained in:
2016-10-11 14:36:16 -04:00
parent 2fe7e70e92
commit 53d82c3e8d
5 changed files with 73 additions and 62 deletions

View File

@@ -1,20 +1,24 @@
// TODO(merwin):
// - uniform color, not per vertex
// - generic attrib inputs (2D pos, tex coord)
uniform mat4 ModelViewProjectionMatrix;
#if __VERSION__ == 120
flat varying vec4 color;
noperspective varying vec2 texcoord;
attribute vec2 pos;
attribute vec2 texCoord;
attribute vec4 color;
flat varying vec4 color_flat;
noperspective varying vec2 texCoord_interp;
#else
flat out vec4 color;
noperspective out vec2 texcoord;
in vec2 pos;
in vec2 texCoord;
in vec4 color;
flat out vec4 color_flat;
noperspective out vec2 texCoord_interp;
#endif
void main()
{
gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
gl_Position = ModelViewProjectionMatrix * vec4(pos, 0.0, 1.0);
color = gl_Color;
texcoord = gl_MultiTexCoord0.st;
color_flat = color;
texCoord_interp = texCoord;
}