Skip to content

Commit

Permalink
Wait 500ms before restarting effect to make it easier to confirm the …
Browse files Browse the repository at this point in the history
…effect in ShaderViewer
  • Loading branch information
tekezo committed Nov 11, 2023
1 parent 51ce2b8 commit f6148b7
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/ShaderViewer/swift/Renderer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ final class Renderer: ObservableObject {
didSet {
renderer = MetalViewRenderer(mtkView: mtkView) {
Task { @MainActor in
try await Task.sleep(nanoseconds: 500 * NSEC_PER_MSEC)

self.renderer?.setEffect(Effect(rawValue: self.effect))
self.renderer?.restart()
}
Expand Down

0 comments on commit f6148b7

Please sign in to comment.