mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-08-02 14:57:31 +03:00
define gl_FragColor for macos
This commit is contained in:
@ -13,6 +13,9 @@ flat in vec2 screen_cell_pos;
|
|||||||
// Position the fragment coordinate to the upper left
|
// Position the fragment coordinate to the upper left
|
||||||
layout(origin_upper_left) in vec4 gl_FragCoord;
|
layout(origin_upper_left) in vec4 gl_FragCoord;
|
||||||
|
|
||||||
|
// Must declare this output for some versions of OpenGL.
|
||||||
|
layout(location = 0) out vec4 FragColor;
|
||||||
|
|
||||||
// Font texture
|
// Font texture
|
||||||
uniform sampler2D text;
|
uniform sampler2D text;
|
||||||
|
|
||||||
@ -28,16 +31,16 @@ const uint MODE_CURSOR_RECT_HOLLOW = 4u;
|
|||||||
void main() {
|
void main() {
|
||||||
switch (mode) {
|
switch (mode) {
|
||||||
case MODE_BG:
|
case MODE_BG:
|
||||||
gl_FragColor = color;
|
FragColor = color;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MODE_FG:
|
case MODE_FG:
|
||||||
float a = texture(text, glyph_tex_coords).r;
|
float a = texture(text, glyph_tex_coords).r;
|
||||||
gl_FragColor = vec4(color.rgb, color.a*a);
|
FragColor = vec4(color.rgb, color.a*a);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MODE_CURSOR_RECT:
|
case MODE_CURSOR_RECT:
|
||||||
gl_FragColor = color;
|
FragColor = color;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MODE_CURSOR_RECT_HOLLOW:
|
case MODE_CURSOR_RECT_HOLLOW:
|
||||||
@ -46,7 +49,7 @@ void main() {
|
|||||||
// rectangle so we take the slowdown for that one.
|
// rectangle so we take the slowdown for that one.
|
||||||
|
|
||||||
// Default to no color.
|
// Default to no color.
|
||||||
gl_FragColor = vec4(0., 0., 0., 0.);
|
FragColor = vec4(0., 0., 0., 0.);
|
||||||
|
|
||||||
// We subtracted one from cell size because our coordinates start at 0.
|
// We subtracted one from cell size because our coordinates start at 0.
|
||||||
// So a width of 50 means max pixel of 49.
|
// So a width of 50 means max pixel of 49.
|
||||||
@ -70,7 +73,7 @@ void main() {
|
|||||||
abs(cell_frag_coord.x - cell_size_coords.x) < eps ||
|
abs(cell_frag_coord.x - cell_size_coords.x) < eps ||
|
||||||
abs(cell_frag_coord.y) < eps ||
|
abs(cell_frag_coord.y) < eps ||
|
||||||
abs(cell_frag_coord.y - cell_size_coords.y) < eps) {
|
abs(cell_frag_coord.y - cell_size_coords.y) < eps) {
|
||||||
gl_FragColor = color;
|
FragColor = color;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user