From e93cfc601b9f51c2fa741b5975ea4afb00a4731b Mon Sep 17 00:00:00 2001 From: agavistas <118552874+agavistas@users.noreply.github.com> Date: Sun, 2 Aug 2026 17:40:34 -0400 Subject: [PATCH] fix: specify internal texture format as rgba8 --- src/backends/render/opengl.zig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/backends/render/opengl.zig b/src/backends/render/opengl.zig index a8240b6f..37e4de7f 100644 --- a/src/backends/render/opengl.zig +++ b/src/backends/render/opengl.zig @@ -295,7 +295,7 @@ pub fn renderTarget(self: *@This(), maybe_texture: ?dvui.TextureTarget) !void { } fn createTexture(pixels: ?[*]const u8, options: dvui.Texture.CreateOptions) !u32 { - if (options.format != .rgba_32) { + if (options.format != .RGBA_32) { log.err("unsupported texture format", .{}); return dvui.Backend.TextureError.TextureCreate; } @@ -303,7 +303,7 @@ fn createTexture(pixels: ?[*]const u8, options: dvui.Texture.CreateOptions) !u32 var texture: u32 = undefined; gl.genTextures(1, &texture); gl.bindTexture(gl.TEXTURE_2D, texture); - gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, @bitCast(options.width), @bitCast(options.height), 0, gl.RGBA, gl.UNSIGNED_BYTE, pixels); + gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA8, @bitCast(options.width), @bitCast(options.height), 0, gl.RGBA, gl.UNSIGNED_BYTE, pixels); switch (options.wrap_u) { .clamp => gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE), -- knotmirror 0.0.1