2D Graphics on Android. Should I use OpenGL ES?

Started by
3 comments, last by Udovis Devoh 10 years, 9 months ago

Hi everyone. I'm making an 2D game for android with some intensive 2D vector graphics. I know it is possible to draw stuff on a Canvas object, but I don't know if it's fast enough for making a game with high FPS.

My game will have a background layer (bitmap image) and some (not-so-simple) vector-based characters over it.

Should I use OpenGL ES?

Should I use a canvas and draw on it? If not, what could I use?

Is OpenGL worth it for 2D graphics?

Is OpenGL much faster than "drawing on canvas" in 2D?

Thank you.

[quote]Firemen get paid even if there's no fire, and that's a good thing -me[/quote]
Advertisement

Depends on the usage, depends on the device.

New devices and new OS versions (Jelly Bean) support hardware acceleration on Canvas drawing. Older systems (60% of devices in the wild) a will keep everything on the main processor.

So for 60% of devices the images will be manipulated uncompressed, will not use video memory, and get no special treatment. Performance will be approximately linear based on the number of items drawn.

If you have 50 or 100 blits to the Canvas, you should be able to reach a reasonable framerate even on old devices. More blits = more memory requirements for each image you are drawing and more CPU time to do the work.

If that is sufficient for your game, then go for it.

Of course you can get much higher performance with OpenGL ES and take advantage of batch operations, compressed textures, asynchronous specialized hardware and memory, and all the other goodies it gives you. But if your game doesn't require it, there is no need to force you down that path.

OpenGL is good. Iam currently studying android game development. I will encourage you to read the pdf.

"Beginning Android Game Development".

It has an opengl tutorial at chapter 7. Goodluck.

OpenGL is good. Iam currently studying android game development. I will encourage you to read the pdf.

"Beginning Android Game Development".

It has an opengl tutorial at chapter 7. Goodluck.

Why dont you guys use an engine built on top of OpenGL? For example: www.andengine.org

Best,

- Pedro / RoTTer

Thank you guys for your advices.

[quote]Firemen get paid even if there's no fire, and that's a good thing -me[/quote]

This topic is closed to new replies.

Advertisement