Fantasizing about C API and plugins

This commit is contained in:
2026-01-16 20:28:08 +01:00
parent 133994d2ef
commit 33a0b241ef
5 changed files with 232 additions and 9 deletions

View File

@@ -141,7 +141,7 @@ pub fn deinit(self: *Textures, engine: *Engine, allocator: std.mem.Allocator) vo
/// Get the ID of a texture given its filename (as a string) and usage. Returns
/// `null` if such texture hasn't been loaded. When the filename is `null`,
/// returns an empty texture ID appropriate for given usage.
pub fn get(self: *const Textures, maybe_filename: []const u8, usage: Texture.Usage) ?Id {
pub fn get(self: *const Textures, maybe_filename: ?[]const u8, usage: Texture.Usage) ?Id {
if (maybe_filename) |filename| {
return self.map.get(.{
// If the atom doesn't exist, then the texture cannot possibly exist.

View File

@@ -51,14 +51,14 @@ pub const Orientation = enum(u3) {
};
pub const Transform = enum(u3) {
identity,
rotate_cw,
rotate_ccw,
rotate_180,
mirror,
mirror_rotate_cw,
mirror_rotate_ccw,
mirror_rotate_180,
identity = 0,
rotate_cw = 1,
rotate_ccw = 2,
rotate_180 = 3,
mirror = 4,
mirror_rotate_cw = 5,
mirror_rotate_ccw = 6,
mirror_rotate_180 = 7,
};
// ┌──────────────────── x