DVUI

destroyLater

Destroy a texture created with textureCreate at the end of the frame.

While Backend.textureDestroy immediately destroys the texture, this function deferres the destruction until the end of the frame, so it is safe to use even in a subwindow where rendering is deferred.

Only valid between Window.beginand Window.end.

Parameters

#
texture:Texture
Texture

Source

Implementation

#
pub fn destroyLater(texture: Texture) void {
    const cw = dvui.currentWindow();
    cw.texture_cache.trash.append(cw.gpa, texture) catch |err| {
        dvui.log.err("Texture destroyLater got {any}\n", .{err});
    };
}