Question about layers

Discuss any general programming issues here
Post Reply
User avatar
Allanon
Posts: 742
Joined: Sun Feb 14, 2010 7:53 pm
Location: Italy
Contact:

Question about layers

Post by Allanon »

Hello,
I'd like to know if there are considerably performance hit using many layers even if they are hidden, I'm asking this because I would like to create all what I need in my app at the beginning to have a more smooth experience at run time, I don't know how layers are handled internally, maybe hidden layers are just ignored...
----------------------------
[Allanon] Fabio Falcucci | GitHub (leaving) | Gitea (my new house) | My Patreon page | All my links
PEB
Posts: 588
Joined: Sun Feb 21, 2010 1:28 am

Re: Question about layers

Post by PEB »

You're probably better off pre-loading brushes rather than creating a bunch of hidden layers. If you keep all your brushes organized (such as by using #LIGHTUSERDATA IDs), then just display the brushes as needed either as seperate layers or by changing the brushes that are assigned to the layers using SetLayerStyle() with {ID=}. I would guess that this would give better performance than having a lot of hidden layers.
User avatar
Allanon
Posts: 742
Joined: Sun Feb 14, 2010 7:53 pm
Location: Italy
Contact:

Re: Question about layers

Post by Allanon »

Yes, I'm currently preloading brushes but since my layers are quiet complex because of more than one brushes are blitted into them the way you suggest could be more slow because of the blitting operations... I should make some benchmarks to see what's the best approach or if some of you have already done these tests could be better :)
----------------------------
[Allanon] Fabio Falcucci | GitHub (leaving) | Gitea (my new house) | My Patreon page | All my links
User avatar
airsoftsoftwair
Posts: 5887
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: Question about layers

Post by airsoftsoftwair »

Yes, hidden layers are just ignored so it shouldn't affect performance too much (unless there are thousands of hidden layers maybe).
User avatar
Allanon
Posts: 742
Joined: Sun Feb 14, 2010 7:53 pm
Location: Italy
Contact:

Re: Question about layers

Post by Allanon »

thank you for the confirm, there are not thousands but hundreds :-)
----------------------------
[Allanon] Fabio Falcucci | GitHub (leaving) | Gitea (my new house) | My Patreon page | All my links
Post Reply