Make the crosshair transparent (#1347)

* make crosshair transparent

* fix styling

* fixes
This commit is contained in:
OneAvargeCoder193 2025-04-27 09:14:07 -04:00 committed by GitHub
parent b70eb60afd
commit 735e99826e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 10 additions and 1 deletions

View File

@ -7,5 +7,8 @@ flat in vec4 fColor;
in vec2 uv;
void main() {
frag_color = texture(image, uv) * fColor;
frag_color = texture(image, uv)*fColor;
if(frag_color.a == 0) {
discard;
}
}

View File

@ -10,6 +10,8 @@ const gui = @import("../gui.zig");
const GuiWindow = gui.GuiWindow;
const GuiComponent = gui.GuiComponent;
const c = main.graphics.c;
const size: f32 = 64;
pub var window = GuiWindow{
.contentSize = Vec2f{size, size},
@ -33,5 +35,9 @@ pub fn deinit() void {
pub fn render() void {
texture.bindTo(0);
graphics.draw.setColor(0xffffffff);
c.glBlendFunc(c.GL_ONE, c.GL_ONE);
c.glBlendEquation(c.GL_FUNC_SUBTRACT);
graphics.draw.boundImage(.{0, 0}, .{size, size});
c.glBlendFunc(c.GL_SRC_ALPHA, c.GL_ONE_MINUS_SRC_ALPHA);
c.glBlendEquation(c.GL_FUNC_ADD);
}