You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As mentioned on the Swift forums a while back, it seems that image loading has a fair amount of delay on application start. I've only tested with a MacOS target so far, but there is a > 1 second delay before my TextureisReady properties are true.
For some context, I added this check in my render function:
for entity in entities {
guard let spriteComponent = entity.component(ofType:SpriteComponent.self),
spriteComponent.sprite()?.texture.isReady == true
else{ continue }
canvas.insert(spriteComponent, at: entity.transform2.position)}
Admittedly, this delay is on fairly large ("full-screen" – i.e. background) textures. If I need to optimize (or show a loading state), I can certainly do that, but I thought I'd create an issue just in case this is still hanging around as a TODO somewhere.
The text was updated successfully, but these errors were encountered:
Yes, this is still an issue. Swift 6 changes will likely fix it but I am currently stuck on a strict concurrency issue with C interop. Resources do have a new immediate option when you construct them. `Texture(path, immediate: true)` this will cause a block instead of using the deferred cache loading. You could try that if these are non-optional resources.
As mentioned on the Swift forums a while back, it seems that image loading has a fair amount of delay on application start. I've only tested with a MacOS target so far, but there is a > 1 second delay before my
Texture
isReady
properties are true.For some context, I added this check in my
render
function:Admittedly, this delay is on fairly large ("full-screen" – i.e. background) textures. If I need to optimize (or show a loading state), I can certainly do that, but I thought I'd create an issue just in case this is still hanging around as a TODO somewhere.
The text was updated successfully, but these errors were encountered: