I'm planning to develop a 2D game for Android devices without a dedicated GPU, like the HTC Wildfire. I remember from the PC that OpenGL is generally to be chosen over something like SDL for 2D graphics because of speed and features.
On Android, there are two APIs for graphics:
Which one should I favor for a 2D game that should run on Android devices without a dedicated GPU?
OpenGL is quite appropriate for 2D games. Although it is generally used for 3D, the same functionality can be used for 2D games. That is to say, anything you can do with 3D OpenGL will be applicable with "2D" OpenGL. Some further information can be found at this location.
What 2D capability does WebGL offer that 2D canvas does not? The biggest one IMHO is the programmable fragment shaders on the graphics hardware. For example, in WebGL, one can implement Conway's Game of Life in a shader on your 3D hardware: This kind of 2D display would only run on the CPU, not the GPU, with a 2D canvas.
As WebGL is particularly new technology and HTML5 canvas is more established what you want to use depends on your users. If you think that your users will use mobile devices then I would suggest HTML5 canvas but if you want better 2D rendering I would use WebGL.
WebGL is unusable without a GPU. This hardware dependency is not a big problem because most systems have GPUs, but if GPU or CPU architectures ever evolve, preserving webgl content by emulation may be challenging. Running it on old (virtualized) computers is problematic.
Depends on your experience and the scope of the game really, there are benefits and drawbacks for both. I would watch the Chris Pruett Google IO Lectures, they helped me out a lot when I was first getting started with game dev on Android.
Personally I went with OpenGL over the canvas (or "normal" as you called it) since I was familiar with it already. The game I am working on under this approach works pretty well (with threading and being careful of the GC) even on the old myTouch phones.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With