A problem with canvas

Tutorials concerning the OpenGL® ES cross-platform API for full-function 2D and 3D graphics on the Google-Android platform.

A problem with canvas

Postby icekimi1988 » Fri May 08, 2009 10:39 am

HI All
sorry for my english
I'm new to android. Now I'm doing a game in android,the game with many sprites and sences,when i doing these in android I use bitmap to draw on cavas,so the with many bitmap to draw on. the cpu will be 50%(core 2 T7300)
the sence build up by many 16pels*16pels PNG. I want to konw How can i solve this problem and android can do it like Double buffering in j2me ? Thank you
icekimi1988
Freshman
Freshman
 
Posts: 2
Joined: Fri May 08, 2009 10:23 am

Top

Postby WarrenFaith » Fri May 08, 2009 1:10 pm

Do you work with SurfaceView?
The cpu usage depend on your game loop. If you draw as fast as possible (without Thread.sleep()) the 50% is normal.
I can recommend a good article for game loop: http://dewitters.koonsolo.com/gameloop.html

As long as your app responces to events and the refresh rate is above 25fps i wouldn't look at cpu usage....
WarrenFaith
Moderator
Moderator
 
Posts: 227
Joined: Fri Mar 13, 2009 10:59 am
Location: Berlin, Germany

Postby icekimi1988 » Fri May 08, 2009 2:30 pm

WarrenFaith wrote:Do you work with SurfaceView?
The cpu usage depend on your game loop. If you draw as fast as possible (without Thread.sleep()) the 50% is normal.
I can recommend a good article for game loop: http://dewitters.koonsolo.com/gameloop.html

As long as your app responces to events and the refresh rate is above 25fps i wouldn't look at cpu usage....

I just work with view not surfaceview , i do not know the difference between surfaceview and view ,and how to use surfaceview in the game ,thank you
icekimi1988
Freshman
Freshman
 
Posts: 2
Joined: Fri May 08, 2009 10:23 am

Top

Return to Android 2D/3D Graphics - OpenGL Tutorials

Who is online

Users browsing this forum: No registered users and 4 guests