Using of iPhone native functionalities in Ogre3D iOS

Discussion of issues specific to mobile platforms such as iOS, Android, Symbian and Meego.
fzh
Gnoblar
Posts: 18
Joined: Wed Nov 21, 2007 7:21 am

Using of iPhone native functionalities in Ogre3D iOS

Post by fzh »

I am currently using Ogre3D for an iphone application. The thing is that there are some functionalities I need, such as reading files during runtime, accessing iphone image picker, camera etc that would need calling of functions from objective-c. I could not find much information regarding this online. Just wondering if anyone has had some experience in implementing such functionalities.
TheSHEEEP
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 972
Joined: Mon Jun 02, 2008 6:52 pm
Location: Berlin
x 65

Re: Using of iPhone native functionalities in Ogre3D iOS

Post by TheSHEEEP »

You're probably in the wrong forum for this ;)

Accessing native libraries like camera, etc. is not related to Ogre in any way.
I'll move the topic to Mobile Devices, though. Probably someone there can answer your question anyway :)
My site! - Have a look :)
Also on Twitter - extra fluffy
Ologon
Halfling
Posts: 70
Joined: Sun Dec 02, 2007 11:10 am
Location: Italy
x 2

Re: Using of iPhone native functionalities in Ogre3D iOS

Post by Ologon »

Yes, Ogre doesn't handle these things for you. You should use objective-c from your code for that, and it's very easy to do as XCode allows you to mix C++ and Obj-C without problems. You just have to rename your source file extension from .cpp to .mm, telling the compiler that you are using some Obj-C in that file.

You can also mix C++ and Obj-C in header files but be careful not to accidentally #include Obj-C code in a cpp file or you'll get errors.