[英]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. 我有一个Android游戏的想法,与通常在屏幕上移动精灵(位图)的典型游戏有些不同。 Id want to plot lots of little pixels to create my visuals.
我想绘制很多小像素来创建我的视觉效果。
PROS 优点
CONS 缺点
WISHES 愿望
PERFORMANCE Q... 性能问题...
You can achieve it in native code using C/C++. 您可以使用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.
您将创建屏幕外位图,获取其内存地址,向其绘制原始RGB像素,然后在View.onDraw方法中将整个屏幕外位图blit到屏幕上。 You can get nice framerates in fullscreen.
您可以在全屏模式下获得不错的帧率。
Btw, Android also manipulates pixels in low level by native code (using Skia library). 顺便说一句,Android还通过本机代码(使用Skia库)来操纵低级像素。 Java classes like Canvas, Bitmap etc just jump to native code to get the work done.
Java类(例如Canvas,Bitmap等)仅跳至本机代码即可完成工作。 Using Android's Canvas in Java to paint pixels would be unrealistically slow.
在Java中使用Android的Canvas绘制像素会非常缓慢。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.