• Advertisement
Sign in to follow this  

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

This topic is 1644 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement