Game Development Reference
In-Depth Information
The loader program is a fixed entity and cannot be changed by us, so Marmalade
provides us with the EDK system to enable us to make platform-specific function
calls. Certain parts of the Marmalade SDK have actually been implemented in just
this manner; for example, the s3eFacebook API is actually an extension!
The only problem with the EDK is that it is not a completely cross-platform solution.
At the time of writing, it was only possible to write extensions for iOS, Android,
Windows, and Mac OSX.
Since this topic is primarily concerned with development using the
Windows version of Marmalade, we won't be looking at how to build
a Mac extension here, however we will need access to a Mac computer
in order to build iOS extensions since, by necessity, we have to use the
Apple iOS SDK, which is not available as a Windows download. For
details on creating Mac extensions, look in the Marmalade documentation
by going to Marmalade (C++) | Extensions Development Kit (EDK) |
EDK Guides by Platform | OS X EDK Guide .
Creating an extension for gyroscope
input
To illustrate the process of creating a Marmalade extension, we'll take a look at how
to add support for gyroscope input. This is a useful addition since it lets us add a
whole new input method to our games yet it also demonstrates just how easy it is to
extend Marmalade's functionality.
Our extension will consist of the following functions:
Function
Description
GyroscopeAvailable
This function is automatically generated for us by the
EDK build process. It returns S3E_TRUE if the Gyroscope
extension is supported for the current platform, and S3E_
FALSE if it isn't.
GyroscopeSupported
Not all mobile devices actually contain gyroscope hardware,
so this function is provided to determine whether or not we
can make use of the gyroscope in our game. The function
returns a normal C++ bool value indicating whether a
gyroscope is present.
Search WWH ::




Custom Search