Jump to content

  • Log In with Google      Sign In   
  • Create Account

Awesome job so far everyone! Please give us your feedback on how our article efforts are going. We still need more finished articles for our May contest theme: Remake the Classics

IPhone development: OpenGL ES or Quartz 2d for a 2d game?


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
21 replies to this topic

#1 shadowisadog   Crossbones+   -  Reputation: 944

Like
0Likes
Like

Posted 31 May 2008 - 11:24 AM

Hello everyone. I am a windows developer currently but I am switching my attention to developing games for the IPhone platform. Work is supplying me with the necessary hardware. I need some advice as to if Quartz 2D is a fast enough API for creating a 2d casual game, or should I work with the OpenGL api directly. While OpenGL would provide the maximum speed, I am not sure if the time cost is worth the speed gain for this project. Has anyone written any 2d games using Quartz 2D? I am new to developing for the Mac OS and so I have a lot of work ahead of me. Thank you for any assistance.

Sponsor:

#2 frob   Moderators   -  Reputation: 7730

Like
0Likes
Like

Posted 31 May 2008 - 12:26 PM

Either would work.

If you are already comfortable with OpenGL, it might be easier for you.

You could even consider going with their core graphics implementation.


#3 Sijmen   Members   -  Reputation: 226

Like
0Likes
Like

Posted 31 May 2008 - 12:45 PM

Quartz 2D seems to be geared towards user interface and 2D graphics like the whole Cocoa UI, and 2D graphics like in edit views of drawing programs. I'd say OpenGL is your best bet, as you can count on it that it will get you all the hardware has to offer.

#4 frob   Moderators   -  Reputation: 7730

Like
0Likes
Like

Posted 31 May 2008 - 01:15 PM

Quote:
Original post by Sijmen
I'd say OpenGL is your best bet, as you can count on it that it will get you all the hardware has to offer.
Nope.

For some tasks, the added processing options that must be available in OpenGL means that the system cannot take advantage of specific hardware improvements for drawing a particular element.

The OPs question was about the performance of the library for a 2D game. All of them perform well. If the OP is concerned only with 2D processing, then there is a good chance OpenGL will perform worse than either Quartz 2D or the core (2D) graphics libraries.

#5 Sijmen   Members   -  Reputation: 226

Like
0Likes
Like

Posted 31 May 2008 - 01:45 PM

Thanks frob, I sit corrected.

#6 shadowisadog   Crossbones+   -  Reputation: 944

Like
0Likes
Like

Posted 02 June 2008 - 07:43 AM

Thank you for the replies everyone. I am just interested in 2d graphics and have no need for any 3d effects at all.

As I have a deadline then I am inclined to go towards the easier API. As long as Quartz (or the core 2d lib) is not significantly slower then OpenGL I should be fine. Since I assume that the 2d drawing APIs are hardware accelerated anyway, this is the responses I was expecting.

Thanks for the help, I will let you guys know how it goes :).

Edit: Oh and sorry for the delay in responding. I figured responses would be much slower on this issue.

#7 bronxbomber92   Members   -  Reputation: 275

Like
0Likes
Like

Posted 03 June 2008 - 01:31 PM

Historically on Mac OS X, Quartz has always been slower than OpenGL. I can't say that for sure on iPhone though.

I'm developing a 2D game for the iPhone using OpenGL and for me it's been a breeze so far. Of course, I'm just a bit more familiar with OpenGL than Quartz (but I have enough experience with Quartz to get my way around it).

#8 shadowisadog   Crossbones+   -  Reputation: 944

Like
0Likes
Like

Posted 27 June 2008 - 09:28 PM

Just wanted to follow up and state that I settled on OpenGL for the game. I really want to ensure that the framerates are high and after reading through the documentation, OpenGL is recommended for games.

Here is a screenshot of my current progress:



It may not seem like a lot, but I have had to learn the Mac OSX, XCode, Interface Builder, Objective C 2.0, and OpenGL as I came from a PC, DirectX, and Visual C++ 2005 background.

I spent a long time reading through technical documents, NeHe tutorials, and looking stuff up on google in order to reach this point.

#9 eng3d   Members   -  Reputation: 102

Like
0Likes
Like

Posted 30 June 2008 - 03:09 AM

Quote:
Original post by shadowisadog

It may not seem like a lot, but I have had to learn the Mac OSX, XCode, Interface Builder, Objective C 2.0, and OpenGL as I came from a PC, DirectX, and Visual C++ 2005 background.


i too want to jump from ms to apple, is hard to work with iphone? the sdk is decent or not?, for example symbian is cool but is pretty tough to work with it.

And, do you buy a mac to work with it? i tried virtualization and is unusable.


Also, Unity3d will promise a lot.


#10 Promit   Moderators   -  Reputation: 2483

Like
0Likes
Like

Posted 30 June 2008 - 04:19 AM

It's my understanding that the entire interface is rendered via OpenGL, so if you know what you're doing, I'd expect it to be the same or slightly quicker to use OpenGL than Quartz. No promises though.

#11 shadowisadog   Crossbones+   -  Reputation: 944

Like
0Likes
Like

Posted 01 July 2008 - 06:16 PM

Quote:
Original post by eng3d
Quote:
Original post by shadowisadog

It may not seem like a lot, but I have had to learn the Mac OSX, XCode, Interface Builder, Objective C 2.0, and OpenGL as I came from a PC, DirectX, and Visual C++ 2005 background.


i too want to jump from ms to apple, is hard to work with iphone? the sdk is decent or not?, for example symbian is cool but is pretty tough to work with it.

And, do you buy a mac to work with it? i tried virtualization and is unusable.


Also, Unity3d will promise a lot.


I received a Macbook to use the SDK and an IPod Touch (Combined total of around $1300 or so). To get your apps on the app store it is $100 a year so that brings the startup total to $1400. Not a bad investment if you are a professional developer.

Keep in mind though that you have to get accepted to the developer program in order to deploy your apps to the IPhone but I imagine that Apple will keep expanding the program as the sdk progresses in beta.

The SDK is not horrible to use but it takes some getting used to. I have made pretty good progress in around a week working with it full time.



#12 ernisj   Members   -  Reputation: 124

Like
0Likes
Like

Posted 14 July 2008 - 05:35 PM

Quote:

I received a Macbook to use the SDK and an IPod Touch (Combined total of around $1300 or so). To get your apps on the app store it is $100 a year so that brings the startup total to $1400. Not a bad investment if you are a professional developer.


Are you sure $100 is a year and not one off fee??



#13 shadowisadog   Crossbones+   -  Reputation: 944

Like
0Likes
Like

Posted 14 July 2008 - 06:28 PM

Almost 100% but I would love to be proven wrong :) .

#14 darkpegasus   Members   -  Reputation: 268

Like
0Likes
Like

Posted 21 July 2008 - 03:10 AM

Yes, it is only $100 to join the program, but from what I understand way more developers have applied than have been accepted to date (4k out of 25k last I heard).

I'm with shadow in the whole going from Windows/Java/Eclipse to Mac/Objective-C/XCode platform and it's a huge shift all at once. I'm impressed you've gotten that much done in a week; I find XCode very hard to use at this point.
Check out my current project on Kickstarter: Genegrafter

#15 shadowisadog   Crossbones+   -  Reputation: 944

Like
0Likes
Like

Posted 28 July 2008 - 04:56 AM

Thanks :) . I have been working on my own framework for use in the engine to make it a bit more like what I am used to. I have also been working on a layout editor in Java (so that it is cross platform) for my game.

If anyone is interested in the way I set it up (unfortunately I am prohibited from providing code) I rewrote Texture2D to be a general image class, I moved the drawing routines to a Graphics class, I wrote a widget manager and widget class and the graphics class gets passed to the widget draw methods. This design is because I am used to the PopCap framework and so I wanted to make my framework similar on both platforms. I plan to implement Vertex buffer objects in order to batch my sprites together for maximum performance.

#16 Rasm   Members   -  Reputation: 283

Like
0Likes
Like

Posted 04 August 2008 - 04:31 PM

I ported my 2D game project from J2ME to Windows Mobile 5/6 and now to iPhone using OpenGL ES and I do have to say that the speed is just incredible on the iPhone. I've worked on several unreleased WM phones with larger screens but the graphics processing capability just wasn't there. OpenGL ES just blazes with plenty of alpha blending.

I guess it's no wonder lots of pc game developers are porting their games onto the iPhone and not just previous mobile developers. It does raise the bar a bit.

#17 joew   Crossbones+   -  Reputation: 2419

Like
0Likes
Like

Posted 04 August 2008 - 05:11 PM

I have been working with the iPhone since the launch of the SDK as a registered developer and I prefer using OpenGL for pretty much any type of game unless it was something purely made of UI elements like crossword, etc.

Also just incase it is of interest to anyone Wolfgang Engel has an iPhone engine that I worked with a little and is pretty great so far: OolongEngine

#18 captainfreedom   Members   -  Reputation: 100

Like
0Likes
Like

Posted 04 August 2008 - 08:20 PM

I had a brief look at OolongEngine.
The 3d part of the libary is just imagination technology's "SDK".
That SDK was to demo their technology and was never intended to be an engine, but it's a good starting point.
It needs a bit of extra work to make it into a real engine. I would expect a real OO class hierarchy (Imgtech use c style code), software skinning (the hardware skinning has a limitation of 9 bones) and replace the hardcoded 3d font completely.


#19 nsxdavid   Members   -  Reputation: 122

Like
0Likes
Like

Posted 23 August 2008 - 03:25 AM

I think the major disadvantage to using OpenGL for games on the iPhone is the non-trivialness (if that's a word) of displaying arbitrary text. There are various font libs out there, but I've yet to find anything drop-in. Given that OpenGL ES doesn't use the Being()/End() symantic of normal OpenGL, most of these libraries cannot be used directly.

Has anyone come across any code specific to the OpenGL ES for fonts/text? Ideally something written in Objective-C.

-- David


#20 captainfreedom   Members   -  Reputation: 100

Like
0Likes
Like

Posted 25 August 2008 - 08:27 PM

I wrote code that uses Anglecode bitmap font generator (http://www.angelcode.com/products/bmfont/) with opengl es. Only took me a couple of days





Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS