Skip to content

Commit 78d0649

Browse files
author
Jay
committed
set_image remember texture_name
1 parent 956c95b commit 78d0649

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/engine.zig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -779,6 +779,8 @@ pub const Element = struct {
779779
}
780780
}
781781

782+
/// Replace the current image texture with a a texture from a resource
783+
/// bundle. Returns null if the resource name does not exist.
782784
pub inline fn set_image(
783785
self: *Element,
784786
gpa: Allocator,
@@ -794,6 +796,7 @@ pub const Element = struct {
794796
}
795797
const end = std.time.milliTimestamp();
796798
debug("set_image loaded image named \"{s}\" in {d}ms", .{ name, end - start });
799+
self.texture_name = name;
797800

798801
if (self.texture != null) {
799802
display.release_texture_resource(gpa, self.texture.?);

0 commit comments

Comments
 (0)