any tips for making CG render faster? - Printable Version
+- iDevGames Forums (http://www.idevgames.com/forums)
+-- Forum: Development Zone (/forum-3.html)
+--- Forum: iPhone, iPad & iPod Game Development (/forum-11.html)
+--- Thread: any tips for making CG render faster? (/thread-96.html)
any tips for making CG render faster? - aerospaceman - Apr 30, 2010 09:09 PM
I am working on a simple 2D game with minimal animation. Basically I am drawing circles and triangle sin my window. It is much slower on iPod touch 1G than in the simulator. I am drawing only the portions of the screen that are changing. But it is very slow! My animated object moves very slow. There are two objects which move, one is animated by the acceleormeter and that seems to be responsive. the other one, a small circle, is a ball that just bounces around. that is moving way slower than in the simulator. I'm afraid that will make the gameplay experience different between 1G and 3G and 3GS because of the different speed of the game.
I have a timer which should take care of the issue but like I said, it moves way slower on the device than in the simulator.
Any ideas accepted.
any tips for making CG render faster? - AnotherJake - Apr 30, 2010 09:55 PM
Definitely should look into using OpenGL
Performance between simulator and device is *wildly* different. The simulator is all software simulation and not at all representative in any way of the performance you will see on any device.
any tips for making CG render faster? - aerospaceman - May 1, 2010 08:55 AM
but OpenGL is...hard!
any tips for making CG render faster? - AnotherJake - May 1, 2010 09:20 AM
OpenGL isn't hard. *Learning* OpenGL can be hard, yes. The learning curve is notoriously steep at first.
Basically, for a 2D game with two sprites, in a ridiculously high-level view of things, it boils down to:
any tips for making CG render faster? - ThemsAllTook - May 1, 2010 09:24 AM
Not as hard as you might think, and the payoff is pretty huge once you learn to use it. I'd recommend buying this book (an old version of which is freely available in HTML), and using Xcode's OpenGL ES application template as a starting point when you run through the examples in the book. It's well worth the effort.
any tips for making CG render faster? - aerospaceman - May 1, 2010 12:14 PM
thanks for the tips...I should have been more clear and say "integrating OpenGL ES with your app once you have most of the coding done" is hard.
I used Glut in C++ and was able to draw stuff easily. But for the iPhone....first I couldn't get the appropriate libraries, then....is there a way to put all this in your view? Like, can I just replace the CG commands with OpenGL functions?
any tips for making CG render faster? - ThemsAllTook - May 1, 2010 03:41 PM
aerospaceman Wrote:is there a way to put all this in your view? Like, can I just replace the CG commands with OpenGL functions?
More or less. It won't be quite as straightforward as replacing CG commands with GL commands, but shouldn't require you to drastically rearchitect your app either. Again, take a look at the OpenGL ES template in Xcode by creating a blank project from it; it's a fantastic reference for bootstrapping a iPhone OpenGL app. You can ignore/disable the ES2 stuff if you don't want to deal with it (which you almost certainly wouldn't need to at this point).
any tips for making CG render faster? - Rasterman - May 3, 2010 07:00 AM
It sounds like your problem might not be the graphics. Are your animations and velocities independent of the frame rate? Even though the frame rate will be much lower on the 1g vs 3g the game experience and feel should be almost the same. Also how are you only redrawing a portion of the screen? This may be the problem.