★ TouchArcade needs your help. Click here to support us on Patreon.

Best graphics framework for gaming newbie?

07-07-2009, 01:04 PM
#1
Joined: Aug 2008
Posts: 55
Best graphics framework for gaming newbie?

Long time coder, first time game-developer.. I have the bare-bones of my game running on the iPhone. The only problem is.. I'm using CoreGraphics (simply because I was already familiar with it) but I'm worried as I add more sprites/effects performance will bog down.

Should I bite the bullet and learn OpenGL? Is the performance gain worth it? It seems to have a steeper learning curve than CoreGraphics.. Would CoreAnimation be easier? AFAIK, that is hardware accelerated.

FYI, the game requires a mostly static background & overlay, about 100 "sprite" blocks (actually static images, only a small number will move at a time) and about a dozen moving and animating character sprites. In the unlikely event there's any horsepower left, I'd like to add explosions/smoke etc. but I'm not counting on it!!

Last edited by whooley; 07-09-2009 at 11:32 AM.
07-08-2009, 02:20 AM
#2
Joined: Feb 2009
Location: Sweden
Posts: 1,634
Quote:
Originally Posted by whooley View Post
Long time coder, first time game-developer.. I have the bare-bones of my game running on the iPhone. The only problem is.. I'm using CoreGraphics (simply because I was already familiar with it) but I'm worried as I add more sprites/effects performance will bog down.

Should I bite the bullet and learn OpenGL? Is the performance gain worth it? It seems to have a steeper learning curve than CoreGraphics.. Would CoreAnimation be easier? AFAIK, that is hardware accelerated.

FYI, the game requires a mostly static background & overlay, about 100 "sprite" blocks (actually static images, only a small number will move at a time) and about a dozen moving and animating character sprites. In the unlikely even there's any horsepower left, I'd like to add explosions/smoke etc. but I'm not counting on it!!
If you are just going for 2D, OpenGL isn't that hard to learn. We more or less only use OpenGL due to a) we know OpenGL already b) we don't like ObjC c) it's very fast and d) we have total freedom and can easily mix 2D and 3D whenever wherever we want.

There are by far more books and tutorials about OpenGL too. In the long run, OpenGL is better since it works just the same on other platforms.

With that said, it is more likely you will be struggling with OpenGL rather than creating your game, at least in the beginning.

07-08-2009, 02:52 AM
#3
Joined: Feb 2009
Posts: 101
Learn OpenGL, it will be much better in the long run and your games will perform much better.

FIPLAB - We make Fascinatingly Interesting Propositions
-> Follow us on Twitter!
-> Add us on Facebook!
07-08-2009, 07:15 AM
#4
Joined: Jan 2009
Location: Sydney, Australia
Posts: 111
I haven't used it myself but I've heard good things about Cocos2D if you want to give that a look.
07-08-2009, 07:52 AM
#5
Joined: Aug 2008
Posts: 55
Cheers for the replies!

OpenGL it is. I guess my initial mistake was trying to "learn OpenGL", rather than just focusing on the 2D basics I needed to get the game done. Free codes for you guys*.

(* in about a year, when I finally get it finished!)
07-08-2009, 07:56 AM
#6
Joined: Aug 2008
Posts: 55
Quote:
Originally Posted by monteboyd View Post
I haven't used it myself but I've heard good things about Cocos2D if you want to give that a look.
Interesting, thanks. I don't think I can get around learning OpenGL (even cocos2d is OpenGL based), but that looks interesting. Having the in-built physics engine is handy too, even if my game's requirements are quite basic.

Last edited by whooley; 07-09-2009 at 06:10 AM. Reason: "Physics", not "graphics". Doh.
07-08-2009, 09:23 AM
#7
Joined: Oct 2008
Posts: 279
Quote:
Originally Posted by Anders View Post
If you are just going for 2D, OpenGL isn't that hard to learn. We more or less only use OpenGL due to a) we know OpenGL already b) we don't like ObjC c) it's very fast and d) we have total freedom and can easily mix 2D and 3D whenever wherever we want.

There are by far more books and tutorials about OpenGL too. In the long run, OpenGL is better since it works just the same on other platforms.

With that said, it is more likely you will be struggling with OpenGL rather than creating your game, at least in the beginning.
Not sure what objC and opengl have anything to do with each other in your comment above. For the record, objC really is awesome and way easier to use in gaming than c. For example, in my new game I just have a particle object that I just create a new instance of whenever I need an explosion and then just run an update on all instances within the object. Easy.

My advice, use objC and opengl. Both are very easy to pick up....

Follow me on Twitter
Games/Ports I have on Appstore
GeoTris $0.99, iPlutoid Free, Neverputt ME $0.99, Noiz2sa Free Free, Neverputt HD $0.99
Coming this year MiZoo 2, 2 untitled games in work
07-08-2009, 09:32 AM
#8
Joined: Feb 2009
Location: Sweden
Posts: 1,634
Quote:
Originally Posted by lazrhog View Post
Not sure what objC and opengl have anything to do with each other in your comment above. For the record, objC really is awesome and way easier to use in gaming than c. For example, in my new game I just have a particle object that I just create a new instance of whenever I need an explosion and then just run an update on all instances within the object. Easy.

My advice, use objC and opengl. Both are very easy to pick up....
CoreGraphics (and the other Apple APIs) require ObjC. OpenGL can be used in C/C++/ObjC.

Choice of programming language is a matter of personal taste. I simply prefer C/C++ (mostly the latter).
07-08-2009, 12:09 PM
#9
doesnt open gl use polygons, vertices and textures? if i had someone doing 2d graphics and they were supplying me with .png files, would open gl be able to use them?
07-08-2009, 12:32 PM
#10
Joined: Feb 2009
Location: Sweden
Posts: 1,634
Quote:
Originally Posted by cool mr croc View Post
doesnt open gl use polygons, vertices and textures? if i had someone doing 2d graphics and they were supplying me with .png files, would open gl be able to use them?
Polygons consist of triangles, which consist of vertices, yes, and they can be textured with images, i.e. textures.

OpenGL renders stuff for you, it doesn't help you with loading images, you will have to do that yourself. If you can load a file and decode it, OpenGL can use it as a texture, whether it may be a PNG file, a JPEG file, a PVRTC file etc.