Chapter 10. Extending Marmalade with the Extensions Development Kit (EDK)

In the previous chapter we mentioned how Marmalade's Extensions Development Kit (EDK) was a possible way of adding functionality to a Marmalade application that had not been otherwise exposed, by using the standard Marmalade APIs.

In this chapter we'll be looking at the following topics:

  • An overview of what the EDK is and why it is needed
  • How to extend Marmalade by creating an EDK extension for Windows, iOS, and Android to support reading gyroscope information

Why is the EDK necessary?

The Marmalade SDK manages to work its magic of being able to take one codebase and deploy it to multiple platforms by providing a set of APIs that sit on top of the APIs specific to each platform.

A deployed application executable actually consists of two separate files. Our application code is compiled into an S3E file, which is the Marmalade equivalent of a Windows Dynamic Link Library (DLL). This file is the same across all platforms.

In order to execute our S3E file, a Loader program is used. This program is the glue between the platform we are running on and our own code. The loader program starts up first, loads the S3E file into memory, and then passes control to the code within it. If our code needs to make a platform-dependant call, it actually makes a request to a function in the loader that will then call the correct operating system function.

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.

Note

Since this book 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.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.119.106.135