Jump to content
  • Advertisement
Sign in to follow this  
nnPawn

Do you have to use OpenGL for decent 2D on Android?

This topic is 2437 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

Working on a game, and i've got all the menus and sound system going, now I have to implement the 2d gameplay. It's not very intense 2D, it's a full screen tiled board with a few small sprite animations, no 3D or exotic 2D techniques needed. Most android tutorials I see use opengl, which seems like it might be a bit overkill for this type of 2D, but then again I don't want any weird tearing or skipping going on if I use regular system drawing calls. I'd probably prefer system calls since it's less setup, but i'll go with whatever works.

Share this post


Link to post
Share on other sites
Advertisement
Drawing onto a View is probably good for a sprite-based game with slower updates; it may take a while for the onDraw/invalidate cycle since invalidates can pile up to prevent issues, but it will get there eventually and it is probably going to be easier to develop.

Drawing onto the Canvas directly will have pretty good performance; just like the 3D performance the actual quality will vary by device.

Share this post


Link to post
Share on other sites
Thanks for the help. What about a SurfaceView, I see some tutorials using that, i'm not sure how different that is from a plain old View(?). Is a canvas better than either for the following case: This game will be about the same graphically as a game like Tetris/Bejewelled/Zuma/etc with around the same amount of animation, no scrolling backgrounds, just one big static background with some small/med sprites moving around on top.

Share this post


Link to post
Share on other sites

Thanks for the help. What about a SurfaceView, I see some tutorials using that, i'm not sure how different that is from a plain old View(?). Is a canvas better than either for the following case: This game will be about the same graphically as a game like Tetris/Bejewelled/Zuma/etc with around the same amount of animation, no scrolling backgrounds, just one big static background with some small/med sprites moving around on top.

You should be fine with any of method. That is low enough refresh rate that it really doesn't matter.

If it were a faster game that needed 15+FPS you would need something with a little more performance. As described, pretty much any rendering system can give acceptable results.

Share this post


Link to post
Share on other sites
I know this post is over a month old but it asks a pertinent question regarding the performance of different 2D rendering methods.

The best discussion of this on Android I've come across is Chris Pruett's 2010 Google IO talk.

You can watch it here:



It's well worth the entire hour of your time if you're new to Android game development.

Share this post


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

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!