Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I am compleatly new to android gaming.
I want to develop a 2D game with some physics in it.
I want to know which one i have to use Open GL or Canvas and the reason for selection
I want to include a physics engine i dont know anything about that too
It will be very help full if anyone can share any idea's and suggections.

Advanced thanks to all ...

share|improve this question
1  
Forget about physics in this first game, and focus on OpenGL –  Zhen Sep 30 '12 at 17:14
add comment

2 Answers

up vote 3 down vote accepted

You may be confusing "Surface View" with drawing via Canvas.

OpenGL allows hardware rendering (makes use of the GPU), even of 2D sprites (which you render to a polygon). This also gives your sprites additional features, such as rotation, hardware scaling, or setting them up in a 3D "perspective" to do things with that (like fake parallax scrolling).

Basically if you want any of the following, you probably have to use OpenGL:

  • Intensive computation - basically anything where you want as much CPU as possible, so you want to push as much to the GPU as possible. Simple physics won't count for this.
  • LOTS of sprites - In the dozens or hundreds.
  • LOTS of scaling or some rotating of sprites - It's (relatively) expensive to scale sprites onto the Canvas, and very expensive/troublesome to rotate sprites on your own.

Drawing bitmaps with the Canvas object is arguably much simpler than implementing OpenGL. However for anything intensive, you may find later the class won't cut it. Basically if you don't need to do any of the above, you should be able to get away with just using Canvas.

share|improve this answer
    
You are right master I siad surface view instead of canvas I had a littile bit confusion on that,Will edit my post .Thank you for your Support –  Renjith K N Sep 7 '12 at 4:04
    
@Ren Glad to help. Let me know if I could narrow the information you're interested in. –  TheMaster42 Sep 7 '12 at 4:59
add comment

It seems you are mixing things... On Android you have to use SurfaceView to display OpenGL.OpenGL is a library and SurfaceView is the viewable part of OpenGL.

OpenGL is not a physic engine as you think,you can't handle speed,acceleration, gravity etc..this is the job of library like andengine,box 2d and many others

I recommand you to read this: http://developer.android.com/guide/topics/graphics/opengl.html

share|improve this answer
    
Hi Vince, Sorry I had a confusion with canvas and surface view I will edit my Post, Thanks for the reply and support –  Renjith K N Sep 7 '12 at 4:05
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.