views:

363

answers:

4

I have to develop an application "Behavior like an Tetris game".

I have never used "OpenGL" for the iPhone application developement.

Application is something like this

  • Red / green / blue square boxes drop from top
  • Red + Red + Red = Points & boxes disappears
  • same way user has to make combination & get points
  • Different levels are there.
  • There are three buttons Left, Right for movement & bottom for speedy fall

For this kind of application should I use open GL or NOT?

i.e. Is it possible to develop entire application with view & it's animation? If yes then, will it be more complex as compare to open gl?

What is the advantage of using open GL? (I know that it gives good 2d, 3d look ) (But here my question means - easy coding?) (Or open gl is more complicated as compare to objective-c?) (I am just asking because I am not aware of it)

+2  A: 

From the tone of your question it looks like you're confusing what OpenGL is and isn't with regard to Objective-C.

OpenGL is a library written in the C programming language (to put it simplistically) that excels at rendering shapes (especially 3D shapes) for display on a screen. It doesn't replace Objective-C inside your program, it merely assists you in drawing the shapes. If you don't use OpenGL, you'll need to write some sort of drawing/rendering code in your NSView (or subclass) to render the blocks. By using OpenGL, you will be provided a lot of helpful C methods for drawing shapes, which otherwise you'll have to implement yourself. On top of that OpenGL has thousands of man hours worth of drawing optimizations that you can take advantage of if you use it rather than trying to implement shape rendering yourself.

Having said that, OpenGL isn't all sunshine and roses. It works like a state machine and has its own assumptions about the way it will be used (like any API). Just because you know C and Objective-C doesn't mean that using OpenGL will be trivial. If you've never written any OpenGL code, I suggest you look into a reference like the venerable Red Book.

The thing to keep in mind is that OpenGL is not a language until itself (ignoring the OpenGL shading language). Its merely a set of C functions to aid you in rendering graphics.

Peter Nix
The Red Book is a great reference for OpenGL development, but probably not so good for iPhone OpenGL *ES* development.
Alex Reynolds
I found following Link.http://maniacdev.com/2009/04/8-great-resources-for-learning-iphone-opengl-es/
sugar
A: 

To learn & understand what you need.

Please go through following link.

it includes all necessary links for all kind of resources that you needed.

http://maniacdev.com/2009/04/8-great-resources-for-learning-iphone-opengl-es/

Edit :

After reading your question properly ( actually my question - By r & d I found solution).

I think - you need to develop a 2d application.

Go for the following link. Best option for 2d animation.

http://code.google.com/p/cocos2d-iphone/

Don't forget to visit following link, if you needed sample codes.

http://monoclestudios.com/cocos2d%5Fwhitepaper.html

sugar
This might be helpful. http://www.bit-101.com/blog/?p=2115
sugar
Video tutorial - http://morethanmachine.com/macdev/?p=83
sugar
Don't Forget to read - http://mitchallen.com/iphone/archives/304
sugar
This will help you to go step by step.http://maniacdev.com/2009/07/11-cocos2d-iphone-game-engine-resources/
sugar
+2  A: 

Basically your options are:

  • Using OpenGL
  • Using Quartz
  • Using UIKit

OpenGL is a fairly complicated beast, but is by far the best way to squeeze performance out of the iPhone. Do you need it for a Tetris game, though? Almost certainly not.

Quartz is the toolkit used in Mac OS X and the iPhone to draw images and do image effects. Because I come from an OpenGL background in other languages, I find Quartz strange and frustrating. However, it is probably easier for someone who is new to both.

You can do everything here using UIKit, and it will definitely be much much easier than other options. The main disadvantage is that it's rather slow in comparison, but once again doing a Tetris-like game shouldn't matter at all.

Before you go with UIKit, though, I recommend just checking out something like Cocos 2D, which will give you the advantages of OpenGL without the headache of dealing with all of its inner workings.

Eli
+1  A: 

You may well want to ask as well on http://iphonegamedev.stackexchange.com/, the new Stack Overflow variant just for iPhone gaming.

Kendall Helmstetter Gelner
Wow - new new new.
sugar