mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-09-05 19:08:17 +00:00
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:
@@ -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,
|
||||
|
||||
|
Reference in New Issue
Block a user