Better (CoreAnimation or OpenGL)

Discussion in 'Mac Programming' started by Miglu, Jul 3, 2010.

  1. Miglu macrumors member

    Joined:
    Jan 22, 2010
    #1
    Which one is better for games, OpenGL or CoreAnimation?
     
  2. lloyddean macrumors 6502a

    Joined:
    May 10, 2009
    Location:
    Des Moines, WA
  3. GorillaPaws macrumors 6502a

    GorillaPaws

    Joined:
    Oct 26, 2003
    Location:
    Richmond, VA
    #3
    Core animation is very simple to implement, so if you have a simple game, I would go that route. But it's somewhat limited, and if you're going to have relatively sophisticated gameplay, you're probably going to have to drop-down to OpenGL.

    If you gave us an example of the type of game you're interested in making, you would likely get a more helpful answer.
     
  4. jared_kipe macrumors 68030

    jared_kipe

    Joined:
    Dec 8, 2003
    Location:
    Seattle
    #4
    To almost any possible answer to, "what kind of games?"
    The correct answer is OpenGL.
     
  5. GorillaPaws macrumors 6502a

    GorillaPaws

    Joined:
    Oct 26, 2003
    Location:
    Richmond, VA
    #5
    Certain kinds of puzzle games can get away with Core animation for example.
     
  6. Miglu thread starter macrumors member

    Joined:
    Jan 22, 2010
    #6
    I meant generally, as I want to know if I should bother learning CoreAnimation before OpenGL. But here is an example: 2D sidescroller.
     
  7. kainjow Moderator emeritus

    kainjow

    Joined:
    Jun 15, 2000
    #7
    2D graphics/animations is what CA excels at. Anything 3D is pushing it and should be done in OpenGL directly. Note though that CA provides ways to work with OpenGL directly.

    CA is really for UI animations and isn't designed to create games although it certainly can. If you're not familiar with either one you'll have a learning curve to get over. 2D is pretty easy in OpenGL once you get the foundations though.

    I would say go directly to OpenGL. There is much more help out there to learn OpenGL for gaming than CA.
     
  8. Cromulent macrumors 603

    Cromulent

    Joined:
    Oct 2, 2006
    Location:
    The Land of Hope and Glory
    #8
    Rather than using OpenGL directly it would probably be better to aim for an already existing graphics engine. There are loads available for the Mac (Ogre3D and Panda3D being the big ones).
     
  9. lloyddean macrumors 6502a

    Joined:
    May 10, 2009
    Location:
    Des Moines, WA
    #9
    Depending upon your programming and math skills, and the type of game you have in mind, I'd have to disagree with you.

    It's been a while since I did a 2D side scroller (Thexder 1988, Amiga and Mac) and OpenGL would be a good choice for this type of game while CoreAnimation would not, while something more akin to Space Invader CoreAnimation would be perfectly adequate and a lot less work!

    The attached Thexder 2D scrolling map demo uses OpenGL, didn't require a third party 3D engine and took about 7 hours to put together. It runs flat out no throttling of any kind and has no game play.
     

    Attached Files:

  10. Miglu thread starter macrumors member

    Joined:
    Jan 22, 2010
    #10
    It seems that now that I have basic Cocoa skills, I should start learning OpenGL instead of CoreAnimation in order to be able to make games. Starting from the OpenGL Programming Guide.
     
  11. chrono1081 macrumors 604

    chrono1081

    Joined:
    Jan 26, 2008
    Location:
    Isla Nublar
    #11
    One thing I would suggest is while learning OpenGL, make sure you are up to snuff on your 3D math skillz.

    If your not a great book is the 3D Math Primer which would be very handy to have while learning OpenGL.
     
  12. MorphingDragon macrumors 603

    MorphingDragon

    Joined:
    Mar 27, 2009
    Location:
    The World Inbetween
    #12
    Correct me if I'm wrong but isn't the majority of graphical mathematics matrices based?
     

Share This Page