If you are doing a game where FPS matters, use OpenGL.  OpenGL isn't
just for 3d, it is a very good high performance 2d or 3d drawing API
that can be hardware accelerated.  Just switch what you are doing in
the SurfaceView from the Canvas API to the OpenGL API.

On Aug 28, 1:36 pm, ross <[EMAIL PROTECTED]> wrote:
> Hi Romain,
>
> Thanks for the info.  I am actually using a SurfaceView now.  I am
> doing something like the following in my main game thread:
>
> public void run() {
>
>   ,,,,,
>
>    SurfaceHolder holder = ....
>
>   while( infinity! ;) )
>   {
>
>     update!
>
>     Canvas canvas = holder.lockCanvas();
>     myPaint(canvas);
>     holder.unlockCanvasAndPost(canvas);
>
>    }
>
> }
>
> inside myPaint I lay it on pretty good :)  and i'm hoping my 15 fps on
> emulator might be a little better on the device?
>
> wondering how much farther OpenGL would take me...
>
> thanks,
> Ross
>
> On Aug 28, 11:17 pm, "Romain Guy" <[EMAIL PROTECTED]> wrote:
>
> > > My understanding was that 2D graphics implemented on top of the Canvas
> > > class would also be accelerated to some extent on the device.  Is this
> > > not the case?
>
> > No, currently the Canvas class uses pure software rendering. This may
> > change in the future though.
>
> > >  Are 2D graphics operations done on top of OpenGL
> > > substantially faster on device than 2D graphics operations done on top
> > > of Canvas?
>
> > Using OpenGL lets you bypass the view hierarchy system, which would
> > probably help in the case of a game. You can also use a solution
> > halfway between the two and simply use a SurfaceView. You can refer to
> > the LunarLander example to see how it's done.
>
> > --
> > Romain Guywww.curious-creature.org
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new Android 0.9 SDK beta!
http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to