Bob,

I recently released a game (actually just this week, called "Prism" or 
"Prism Light" by Shadowpuppets), which doesn't use OpenGL at all. I just 
draw onto the canvas from my overrided onDraw method, and then invalidate 
only the part of the view which contains animation. I have determined that 
the drawing portion is the bottleneck for me (i.e. all the "physics" 
calculations and the rest of the game engine have no effect on the 
framerate). For your reference, I have an original Motorola Droid and I 
generally get around 60 frames per second of animation. During beta testing, 
other users with more advanced phones got upwards of 100 frames per second 
(I actually had to put a frame rate limiter in my game to keep it at 60 fps 
max).

*However!* This is my experience only and is unique to my game. If you 
download and play the free version, then you'll notice that my game board 
only takes up about 2/3 of the screen (and that is the *only* part of the 
screen which can be animated in my game). Furthermore, the performance 
increased drastically when I clipped the regions of the screen which didn't 
contain any animation. For example, my worst possible case scenario was 
needing to animation something in the top left corner and the bottom right 
corner at the same time. This causes the entire view to be redrawn and 
results in my worst frame rate scenario. In this case, the frame rate 
dropped to around 40 or 45 fps. At any other time, when the clipped region 
didn't take up the entire game board the frame rate increased upwards and 
past 60 fps (of note: even though the region was clipped, I still drew all 
the animations to the canvas, even if they were totally outside the clipped 
region. This didn't seem to affect the increased frame rate -- that is, it 
mostly depended on what actually gets pushed out to the screen buffers). So, 
it varies, but overall I got acceptable performance.

Also, depending on what devices you target, there are other options. For 
instance, if you're just targeting Honeycomb then you can enable hardware 
acceleration for your view with only the addition of 1 line of Java code 
(see the Developer's Guide recent Blog on the subject).

I haven't tried using OpenGL for my game, because overall I didn't need it. 
I was prepared to try, but I found that drawing my 2D animated game onto a 
view's canvas was sufficient for my purposes. I hope that this gives you the 
perspective you were looking for.

Nick

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to