kitty/kitty/cursor_vertex.glsl
Kovid Goyal df4df76d24
Switch to using an opaque block cursor
The text is rendered in the background color on top of the opaque
block cursor. We use the background color since applications can change
both cursor and background colors, so it is up to the application to
ensure the colors have good contrast. Fix #126
2017-09-17 13:03:02 +05:30

19 lines
401 B
GLSL

#version GLSL_VERSION
uniform vec4 pos;
const uvec2 pos_map[] = uvec2[4](
uvec2(1, 0), // right, top
uvec2(1, 1), // right, bottom
uvec2(0, 1), // left, bottom
uvec2(0, 0) // left, top
);
void main() {
vec2 xpos = vec2(pos[0], pos[2]);
vec2 ypos = vec2(pos[1], pos[3]);
uvec2 pos = pos_map[gl_VertexID];
gl_Position = vec4(xpos[pos[0]], ypos[pos[1]], 0, 1);
}