Creating a "Object" Class

Moderator
Posts: 770
Joined: 2003.04
Post: #16
2xp Wrote:4 - is there any standard 3d format on macos ? do you guys use 3ds ? is there any standard file loader out there which will give me nice and clean vertices directly ?

The OBJ format is very easy to load and most 3D apps can export to it. You can find a lot of sample code for loading .obj, but you could write a loader yourself in 10 min.
Quote this message in a reply
2xp
Unregistered
 
Post: #17
thanks for the replies

Quote:SOUR-Monkey : There is also Blender, a free 3D modelling application.

i already use blender.

anyway don't mind for all the questions. i read a few pages about objectiveC and it seems that it doesn't support overloading and templates and everything else c++ has to offer. hmm, i guess i'll have to fetch a book about cocoa instead of planning to make this game. i just hope apple has strong motivations choosing objectiveC and game developers can hope to create a good game engine using cocoa.

=> i was thinking, what's the best game (i mean with the most features) that was based upon cocoa ? in choosing cocoa, am i limited to 90's-style platform games ? and what about carbon ?
Quote this message in a reply
Member
Posts: 70
Joined: 2004.06
Post: #18
You most likely would not use Cocoa for a game, but rather only for specific parts of it, ie. use Cocoa for the GUI, and OpenGL for the graphics engine.
Quote this message in a reply
Moderator
Posts: 608
Joined: 2002.04
Post: #19
No, Objective-C does not have operator overloading (most would argue that's a good thing), and templates are not needed.

Quote:=> i was thinking, what's the best game (i mean with the most features) that was based upon cocoa ? in choosing cocoa, am i limited to 90's-style platform games ? and what about carbon ?
I have no idea, it's mighty hard to tell Cocoa games from Carbon games.
Quote this message in a reply
Member
Posts: 70
Joined: 2004.06
Post: #20
I can't see how it would make a difference anyway. The features you include in your game will be limited by your imagination and technical ability, not by whether you use Cocoa or Carbon. Neither of them are limiting languages, except for Cocoa not supporting OS 9. I would just pick whatever language I liked the look of the most, and use that.
Quote this message in a reply
2xp
Unregistered
 
Post: #21
Quote:You most likely would not use Cocoa for a game, but rather only for specific parts of it, ie. use Cocoa for the GUI, and OpenGL for the graphics engine.


what do u mean ? what do u guys use for the core engine ?

=> carbon ??? coming from the pc world where everythin i made was in c++, i don't know how a game developer would do an engine in plain C.

=> or do use C++ and bridge it with cocoa (just saw it was possible yesterday but not sure how is that made) ?

Quote:except for Cocoa not supporting OS 9.

i don't plan to make games for macos9, i don't even "master" macosX, i wouldn't know how to port the game to another OS
Quote this message in a reply
Moderator
Posts: 1,560
Joined: 2003.10
Post: #22
2xp Wrote:what do u mean ? what do u guys use for the core engine ?

The core engine typically should be independent of the API used.

2xp Wrote:=> carbon ??? coming from the pc world where everythin i made was in c++, i don't know how a game developer would do an engine in plain C.

Object orientation is a state of mind, not a language feature. In C, I create "objects" as as structs with associated functions. I've never hit any major limitations with this approach, and never seen any reason at all to use C++.

That said, there's no reason you can't use C++ with Carbon. It's done all the time.

2xp Wrote:=> or do use C++ and bridge it with cocoa (just saw it was possible yesterday but not sure how is that made) ?

Using Cocoa requires you to use Objective-C. You can use Objective-C++, but not pure C++.

Alex Diener
Quote this message in a reply
Moderator
Posts: 770
Joined: 2003.04
Post: #23
OK, just in case all of the above wasn't clear: you can use c++, with Carbon (easy) and with Cocoa (easy or hard, depending on how much do you want Obj-C and C++ to interact).

Personally, I use SDL and C++ for all my game projects. SDL uses Cocoa internally, but all my code is C++. The only problem is that if you use both Cocoa and C++, you'll get some long compile times.

You can also use both Carbon and Cocoa in the same game too: for instance, the SpeechSynth manager in Carbon has a lot of features not available on the Cocoa API for it, so you could write your entire game/app in Cocoa and wrap Carbon API calls inside an Obj-C class.
Quote this message in a reply
Moderator
Posts: 770
Joined: 2003.04
Post: #24
ThemsAllTook Wrote:In C, I create "objects" as as structs with associated functions.

Well, the only difference between a struc with associated functions and a class is that struct members are public by default and class members are private... unless you mean functions like my3DThingFuncA(3DThing *thing,....). If that's the case, then you are just a step away from C++ Smile

ThemsAllTook Wrote:Using Cocoa requires you to use Objective-C. You can use Objective-C++, but not pure C++.

Not exactly: you can write 99% of your code in pure C++, and the bridge it with Obj-C using separate Obj-C++ (.mm) or even plain C files. That's what I usually do unless I'm making a OS X only, "GUI" app (then I use Cocoa only).
Quote this message in a reply
Post Reply