C++ or Objective C
2 posters
C++ or Objective C
Hi everybody!
I'm new to iphone development but usually I program game in OpenGL and C++.
My question is: If I use this engine, should I use C++ or Objective C?
Thanks a lot.
I'm new to iphone development but usually I program game in OpenGL and C++.
My question is: If I use this engine, should I use C++ or Objective C?
Thanks a lot.
riruilo- Posts : 9
Join date : 2008-09-30
Re: C++ or Objective C
Well that's the great thing about objective-C, you can have in the same file (.mm) Obj-C, Obj-C++, C & C++ code and compile just fine, me too at the beginning as was skeptical but... I had also the same questions as you when I first start coding on the iPhone and now well... Check the source tree of (ie:) the template project in SIO2:
SIO2 = Pure C ANSI ISO 99
Bullet = Pure C++
The OpenGL ES window on an iPhone + (IO) = Obj-C
You can code code your game entirely in C++ if you want to...
Actually me I would suggest you C, but that's my own preference , cuz at the end of the day a game its all about control & speed, and I feel that pure C give me all that...
I remember that when I first start creating engines I was also all C++, but I remember that one day one guy challenge me and say "that's impossible to create a 3D engine in C++", and I say "ho really?" and start doing some tests just for fun, and finally I never get back to C++ for the engine code only pure C and SIO2 is my 3rd engine.
Checkout the SIO2 code that might give you some ideas
SIO2 = Pure C ANSI ISO 99
Bullet = Pure C++
The OpenGL ES window on an iPhone + (IO) = Obj-C
You can code code your game entirely in C++ if you want to...
Actually me I would suggest you C, but that's my own preference , cuz at the end of the day a game its all about control & speed, and I feel that pure C give me all that...
I remember that when I first start creating engines I was also all C++, but I remember that one day one guy challenge me and say "that's impossible to create a 3D engine in C++", and I say "ho really?" and start doing some tests just for fun, and finally I never get back to C++ for the engine code only pure C and SIO2 is my 3rd engine.
Checkout the SIO2 code that might give you some ideas
Re: C++ or Objective C
Thanks for your reply.
But I have some questions after reading your reply.
Why create an engine using C and not C++? I don't understand you. Ogre3D, Unreal Engine, OpenSceneGraph... all of them are been created using C++.
Anyway, I don't care too much about this if I don't "see" your source code. My last question, Can I develop a game using C++ and OO paradigm with sio2 engine? I don't have time to learn Objective C (I don't like it and I don't want it) and when I create a game I always use OO paradigm, I think is easier than procedural programming (or C).
Thanks a lot for your time.
Any suggestions?
But I have some questions after reading your reply.
Why create an engine using C and not C++? I don't understand you. Ogre3D, Unreal Engine, OpenSceneGraph... all of them are been created using C++.
Anyway, I don't care too much about this if I don't "see" your source code. My last question, Can I develop a game using C++ and OO paradigm with sio2 engine? I don't have time to learn Objective C (I don't like it and I don't want it) and when I create a game I always use OO paradigm, I think is easier than procedural programming (or C).
Thanks a lot for your time.
Any suggestions?
riruilo- Posts : 9
Join date : 2008-09-30
Re: C++ or Objective C
My last question, Can I develop a game using C++ and OO paradigm with sio2 engine?
>> Yes absolutely
>> Yes absolutely
Re: C++ or Objective C
You are right, but quake 3 is a little bit special, even has some ASSEMBLER parts inside. Did you download this engine? It is impossible to read the source code. Too difficult.
When I say easier, I mean easier to build and develop a game. Of course, probably a C engine is more efficient than a C++ engine (linux kernel has been created using C rather than C++ because of this reason)
Thanks for reply.
When I say easier, I mean easier to build and develop a game. Of course, probably a C engine is more efficient than a C++ engine (linux kernel has been created using C rather than C++ because of this reason)
Thanks for reply.
riruilo- Posts : 9
Join date : 2008-09-30
Re: C++ or Objective C
hmmm? what happen to the rest of my message about Quake 3 and being a carmack fan? anyway...
You are right, but quake 3 is a little bit special, even has some ASSEMBLER parts inside. Did you download this engine? It is impossible to read the source code. Too difficult.
>> Yes I did and I actually inspire myself from their structure to create SIO2 (and steal some bits and pieces from it as well, but don't tell iD Software)
When I say easier, I mean easier to build and develop a game.
>> Easier hmmm yes and no, its just take a little "get used too", but once your fine with it well the rest is easy
Of course, probably a C engine is more efficient than a C++ engine (linux kernel has been created using C rather than C++ because of this reason)
>> Definitely, especially when you are developing cross platform and target low end to high end device. The engine that Im coding at work have to work on: Windows, Mac, Linux, iPhone, iPod Touch & Windows CE (I even compile the engine and run it on the NDS of my wife , and can probably run it on others that we didn't even try...) so by having an engine written in pure C its also easier to port and you know that in any case the performance for the specific device will be great.
You are right, but quake 3 is a little bit special, even has some ASSEMBLER parts inside. Did you download this engine? It is impossible to read the source code. Too difficult.
>> Yes I did and I actually inspire myself from their structure to create SIO2 (and steal some bits and pieces from it as well, but don't tell iD Software)
When I say easier, I mean easier to build and develop a game.
>> Easier hmmm yes and no, its just take a little "get used too", but once your fine with it well the rest is easy
Of course, probably a C engine is more efficient than a C++ engine (linux kernel has been created using C rather than C++ because of this reason)
>> Definitely, especially when you are developing cross platform and target low end to high end device. The engine that Im coding at work have to work on: Windows, Mac, Linux, iPhone, iPod Touch & Windows CE (I even compile the engine and run it on the NDS of my wife , and can probably run it on others that we didn't even try...) so by having an engine written in pure C its also easier to port and you know that in any case the performance for the specific device will be great.
Similar topics
» Question Regarding Scripting in SIO2: LUA, C, C++, Objective-C
» invoking objective-c messages and invoking SiO2 API calls from obj-c
» TEXTFIELD: how to use keyborad and objective c textfield
» invoking objective-c messages and invoking SiO2 API calls from obj-c
» TEXTFIELD: how to use keyborad and objective c textfield
Permissions in this forum:
You cannot reply to topics in this forum