Using of iPhone native functionalities in Ogre3D iOS

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

Using of iPhone native functionalities in Ogre3D iOS

Post by fzh » Thu Jan 10, 2013 8:55 am

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.
0 x

TheSHEEEP
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 972
Joined: Mon Jun 02, 2008 6:52 pm
Location: Berlin

Re: Using of iPhone native functionalities in Ogre3D iOS

Post by TheSHEEEP » Thu Jan 10, 2013 4:59 pm

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 :)
0 x
My site! - Have a look :)
Also on Twitter - extra fluffy

Ologon
Halfling
Posts: 70
Joined: Sun Dec 02, 2007 11:10 am
Location: Italy

Re: Using of iPhone native functionalities in Ogre3D iOS

Post by Ologon » Fri Jan 11, 2013 12:57 pm

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.
0 x

Post Reply