Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Delay as graphics assets become available #48

Open
mgrider opened this issue Aug 5, 2024 · 1 comment
Open

Delay as graphics assets become available #48

mgrider opened this issue Aug 5, 2024 · 1 comment

Comments

@mgrider
Copy link

mgrider commented Aug 5, 2024

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:

        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.

@STREGA
Copy link
Contributor

STREGA commented Aug 5, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants