Objective C or C++ ...& OpenGL ES

Discussion in 'Public Game Developers Forum' started by pchukwura, Sep 18, 2010.

  1. Mr Jack

    Mr Jack Well-Known Member

    No, you're not. Quake wasn't written in Obj-C.

    Carmack has said he prefers the way Obj-C does OO to the way C++ does it.
  2. Phi6

    Phi6 Well-Known Member

    Dec 6, 2008
    Hang on, I thought OpenGL API could only be called in C/C++ anyway?
    I'm pretty sure there's no ObjC bindings for OpenGL?
  3. NickFalk

    NickFalk Well-Known Member

    Since Obj-C is a strict superset of C the two can easily be mixed...
  4. Phi6

    Phi6 Well-Known Member

    Dec 6, 2008
    Yes, that's correct, but it doesn't mean there are ObjectiveC OpenGL types and messages?

    I'm talking about those app developers who purely use Objective C syntax, for example, always using NSInteger and NSString over ints and char arrays..

    In the end if they want to use OpenGL they will have to learn syntax that is unknown to them.. there's no getting around that surely?
  5. NickFalk

    NickFalk Well-Known Member

    Well for 2D work a lot of us use Cocos2D which adds a nice level of Objective-C abstraction between us and the fiddly Open-GL bits. ;)
  6. Phi6

    Phi6 Well-Known Member

    Dec 6, 2008
    Ah yes, thats definitely helpful! Also the Sparrow framework which is similar but more lightweight.

    I'd like to see something like that for 3D though, even SIO2 needs C/C++ OpenGL calls. Not Unity either as that is just the other extreme.

    What I'd like is something akin to Papervision3D for AS3
  7. TheBunny

    TheBunny Well-Known Member

    Nov 8, 2008
    MMO Mac Lead ZeniMax Online
    I believe the original level editor for DOOM was done a NEXT box using cocoa / object C and then cross compiled.

    Might be what you are thinking of?

    This is back in like 93.
  8. GlennX

    GlennX Well-Known Member

    May 10, 2009
    Yeah it was a long time ago I remember him 'blogging' (OK, the term blog wasn't even used back then) about why Objective C was better than C++. Presumably he has switched to C++ at some point in the intervening years.
  9. wadevondoom

    wadevondoom Member

    Sep 22, 2010
    C++ vs. Obj-C

    I would suggest that having both under your belt is a good thing. As previously mentioned a lot of people use C++ if they plan to port as this is much easier with Obj-C.

    I use cocos2d for my current game and it has a couple of physics engines (box2d and chipmunk) that both require you to be able to understand / code in C++.
  10. mh114

    mh114 Active Member

    (My first post here, hi guys! :))
    I went with C++ with some Objective-C++ for my first iOS-game (a bit more than what's required, but not much), mainly because I've been writing C++ for years and not a single line of Obj-C before this game. I'm still much more comfortable in C++ although Obj-C doesn't seem as scary anymore.. ;)

    Currently the gut feeling is that I will be using C++ in the future as well, but I think I'll increase the amount of Obj-C as I get more familiar with it. And this is games speaking, for normal applications I would go Obj-C all the way. :)

    The game is (much improved) port form my earlier Android-game, and it's currently in review at Apple. I will be making a thread about it when it gets live, no worries. :p Coming from Android SDK, I like the iPhone SDK better (and not only because I can use C and C++), although I do still prefer Eclipse over Xcode. But this is getting off-topic.
  11. pchukwura

    pchukwura Well-Known Member

    Sep 15, 2010
    Co-Founder/Software Engineer
    Ya, so far I've been using Obj C for handling touch, loading resources (sprites), the game timer & EAGLView stuff and C++ for everything else. So far everything has been going smooth.

Share This Page