summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-09-25 22:47:16 -0300
committerGabriel Schneider <[email protected]>2026-09-25 22:47:16 -0300
commit5523d23a46821d1fc65d670edd636c040d280a32 (patch)
tree71dd28f451473e83e4b1aea6bce0ce13f9b2a8a5 /src
parent2dfddee8c6fab6eb76cbfe3d95f7c30bfb870702 (diff)
downloadsketchbook-5523d23a46821d1fc65d670edd636c040d280a32.tar.gz
sketchbook-5523d23a46821d1fc65d670edd636c040d280a32.zip
sketchbook: fills blend
The renderer's draw blend mode was left at SDL's default, none, so every translucent fill (panels, labels, HUD bars) drew opaque natively while the web honored alpha. It blends now.
Diffstat (limited to 'src')
-rw-r--r--src/host/Host.zig2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/host/Host.zig b/src/host/Host.zig
index 92d1b55..d511099 100644
--- a/src/host/Host.zig
+++ b/src/host/Host.zig
@@ -111,6 +111,8 @@ pub fn init(self: *Host, gpa: std.mem.Allocator, io: std.Io, environ: *const std
errdefer c.SDL_DestroyRenderer(renderer);
errdefer if (gpu) |device| c.SDL_DestroyGPUDevice(device);
if (!options.headless) _ = c.SDL_SetRenderVSync(renderer, 1);
+ // Colors carry alpha: fills blend, as they do on the web.
+ _ = c.SDL_SetRenderDrawBlendMode(renderer, c.SDL_BLENDMODE_BLEND);
var state = try memory.StateFile.open(gpa, options.state);
errdefer state.close();