Game Development Reference
In-Depth Information
Making an iOS extension
Building an EDK extension for iOS is a little more involved as it requires us to have
access to the Apple iOS SDK and therefore an Apple Mac.
Installing the required software for iOS
development
Firstly, you will need to download the iOS SDK that is bundled together with
Apple's XCode development environment. Head over to the following web page,
which will contain a link to open the Mac App Store where the latest version of
XCode can be downloaded:
https://developer.apple.com/xcode/index.php
Once XCode has downloaded and you have installed it, you will then need to
download the Marmalade SDK in its Mac OS X incarnation. Head over to the
Marmalade website at the following URL, log in, and download the Mac version
of Marmalade.
https://www.madewithmarmalade.com/downloads
Install the Marmalade SDK to the default location. If you only have a single
Marmalade license, you will need to use the Marmalade website to release the
license from your PC so you can use it on the Mac. Refer to Chapter 1 , Getting
Started with Marmalade , of this topic for more information on how to do this.
Creating an iOS extension
Unsurprisingly, we create the files needed for the iOS Extension in a similar manner
to the Windows and Android extensions. Just right-click on the Gyroscope.s4e ile
and select the menu option Build iPhone Extension .
Just two new files will be created for the iOS extension. These are Gyroscope_
iphone.mkb , which is the MKB file that we will use to build the extension code,
and source\iphone\Gyroscope_platform.mm , which contains the auto-generated
stubs for our API functions.
Implementing an iOS extension
To implement the iOS version of the Gyroscope extension, we need to edit the
Gyroscope_platform.mm file. This file is an Objective-C source file that also allows
us to use C and C++ code in the same file. The function stubs are all standard C-style
functions, but we can still make use of Objective-C classes and features within them.
 
Search WWH ::




Custom Search