renderer: unify image.zig

The code in metal/image.zig and opengl/image.zig was virtually identical
save for the texture options, so I've moved that to the GraphicsAPI and
unified them in to renderer/image.zig
This commit is contained in:
Qwerasd
2025-06-23 13:12:17 -06:00
parent 7eb3e813dd
commit df8dc33ab6
6 changed files with 96 additions and 465 deletions

View File

@@ -14,6 +14,10 @@ const link = @import("link.zig");
const cellpkg = @import("cell.zig");
const fgMode = cellpkg.fgMode;
const isCovering = cellpkg.isCovering;
const imagepkg = @import("image.zig");
const Image = imagepkg.Image;
const ImageMap = imagepkg.ImageMap;
const ImagePlacementList = std.ArrayListUnmanaged(imagepkg.Placement);
const shadertoy = @import("shadertoy.zig");
const assert = std.debug.assert;
const Allocator = std.mem.Allocator;
@@ -78,16 +82,10 @@ pub fn Renderer(comptime GraphicsAPI: type) type {
const Buffer = GraphicsAPI.Buffer;
const Texture = GraphicsAPI.Texture;
const RenderPass = GraphicsAPI.RenderPass;
const shaderpkg = GraphicsAPI.shaders;
const imagepkg = GraphicsAPI.imagepkg;
const Image = imagepkg.Image;
const ImageMap = imagepkg.ImageMap;
const Shaders = shaderpkg.Shaders;
const ImagePlacementList = std.ArrayListUnmanaged(imagepkg.Placement);
/// Allocator that can be used
alloc: std.mem.Allocator,