Page 1 of 1

Question about layers

Posted: Fri Mar 30, 2012 3:40 pm
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...

Re: Question about layers

Posted: Fri Mar 30, 2012 4:56 pm
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.

Re: Question about layers

Posted: Fri Mar 30, 2012 6:19 pm
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 :)

Re: Question about layers

Posted: Fri Mar 30, 2012 10:45 pm
by airsoftsoftwair
Yes, hidden layers are just ignored so it shouldn't affect performance too much (unless there are thousands of hidden layers maybe).

Re: Question about layers

Posted: Sat Mar 31, 2012 12:38 am
by Allanon
thank you for the confirm, there are not thousands but hundreds :-)