Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

MatthewF

macrumors newbie
Original poster
Jun 27, 2010
21
0
Would CALayers be powerful enough to handle a tile-based game with around 800 tiles moving at once?
(Would it also work well with one CALayer per tile?)

Thanks,
-Matt
P.S. Would OpenGl be better for this task then CALayers? I really like using CAAnimation instead of making timers and manually doing it by hand. Is there a way to have incredible performance and CAAnimation?
 
Last edited:

MatthewF

macrumors newbie
Original poster
Jun 27, 2010
21
0
An OpenGl tile base engine produces good results. I'm working on the CALayer tile engine at the moment.

If CALayer results are dissatisfying is there a way for me to use OpenGl with CAAnimation?
I think I saw something about a CAEAGLLayer...


-Matt
 

HiRez

macrumors 603
Jan 6, 2004
6,250
2,576
Western US
Is this a Mac game or an iPhone/iPad game? 800 layers on the desktop seems entirely reasonable (in fact I've seen CoreAnimation layer demos with more than that moving simultaneously). On a mobile device it's questionable, especially if most of your layers are not very small. If I had to guess, I'd say 800 layers on an iPad is not going to work very well currently. Also have to consider the limited RAM. Big difference between a 2+ GHz multicore desktop CPU with dedicated GPU and a mobile CPU/GPU with limited resources.
 

MatthewF

macrumors newbie
Original poster
Jun 27, 2010
21
0
I have my CALayer tile engine working and the results are great. Though the only downside is that it appears that a white line can appear between the tiles as the world moves... is there any way to fix that?

Figured it out. Just had to make the frame extend 1 pixel out on each side.


Thanks,
-Matt
P.S. Would CAOpenGLLayer have better performance than a CALayer when just displaying an image?
 
Last edited:
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.