简体   繁体   中英

Is Android (read typical devices) fast enough for a game that requires plotting pixel by pixel rather than blitting

i have an idea for an Android game which is a little different from the typical game that usually moves sprites(bitmaps) around the screen. Id want to plot lots of little pixels to create my visuals.

PROS

  • no bitmaps required
  • pixel plotting of stuff like "fire" can react to wind.
  • no need to scale bitmaps, works w/ any screen res (lets pretend device can handle more drawing because its got a bigger screen).

CONS

  • slower to plot pixels than blit bitmaps
  • need lot of animation frames.

WISHES

  • id like to update my game in real time, more is better 30fps is good but not essential, 15fps is enough.

PERFORMANCE Q...

  • Is the typical Android device fast enough to plot say half a screenful of pixels w/ a default background ?
  • if full screen is not practical what window size should be able to handle such refreshes

You can achieve it in native code using C/C++. You would create offscreen bitmap, get its memory address, draw raw RGB pixels to it, then blit entire offscreen bitmap to screen in View.onDraw method. You can get nice framerates in fullscreen.

Btw, Android also manipulates pixels in low level by native code (using Skia library). Java classes like Canvas, Bitmap etc just jump to native code to get the work done. Using Android's Canvas in Java to paint pixels would be unrealistically slow.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM