style(renderer): capture generic consts as decls in returned struct

Out of an abundance of caution, since there have been issues in the past
relating to consts outside of the returned struct.
This commit is contained in:
Qwerasd
2025-06-20 14:51:55 -06:00
parent b9e35c5970
commit dccbec2283

View File

@@ -68,24 +68,24 @@ const log = std.log.scoped(.generic_renderer);
/// [ Texture ] - An abstraction over a GPU texture.
///
pub fn Renderer(comptime GraphicsAPI: type) type {
const Target = GraphicsAPI.Target;
const Buffer = GraphicsAPI.Buffer;
const Texture = GraphicsAPI.Texture;
const RenderPass = GraphicsAPI.RenderPass;
const shaderpkg = GraphicsAPI.shaders;
const cellpkg = GraphicsAPI.cellpkg;
const imagepkg = GraphicsAPI.imagepkg;
const Image = imagepkg.Image;
const ImageMap = imagepkg.ImageMap;
const Shaders = shaderpkg.Shaders;
const ImagePlacementList = std.ArrayListUnmanaged(imagepkg.Placement);
return struct {
const Self = @This();
const Target = GraphicsAPI.Target;
const Buffer = GraphicsAPI.Buffer;
const Texture = GraphicsAPI.Texture;
const RenderPass = GraphicsAPI.RenderPass;
const shaderpkg = GraphicsAPI.shaders;
const cellpkg = GraphicsAPI.cellpkg;
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,