DVUI

destroyLater

Destroy target from Target.create at the end of the frame.

While Backend.textureDestroyTarget 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

#
self:Target
Target

Source

Implementation

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