Game Development Reference
In-Depth Information
Note however that all the stubbed functions end with the suffix _platform . The EDK
system actually generates a set of generic functions with the exact names specified
in the S4E file that calls the equivalent functions that are suffixed with _platform , if
they exist. This is necessary so that code that uses an extension can still be compiled
and executed on a platform for which an extension has not, or cannot, be created.
Implementing a Windows extension
Ordinarily we would need to modify the Gyroscope_platform.cpp ile to
implement the extension; but for our purposes no changes are actually necessary
as the generated stubs provide the desired functionality on Windows.
Obviously, in this case a Windows extension is a little redundant, but bear in mind
we could always create a more complex extension that somehow emulates gyroscope
behavior, perhaps using a joystick or some other input device.
Building a Windows extension
To build the extension, we just double-click the Gyroscope\Gyroscope_windows.
mkb file to create a Visual Studio project. Once Visual Studio starts up, select the (x86)
Release build type from the drop-down menu at the top of the Visual Studio IDE,
go to the menu option Build | Build Solution (or just press the F7 key), and the
Windows version of the extension will be created. Simple!
Making an Android extension
Now we'll turn our attention to Android. We'll need to install some software
before we can begin, though, as the build process needs to be able to access Java
development tools and the Android SDK.
Installing the required software for Android
development
First of all you will need to install the Java JDK, which is available for download
at the following address:
http://www.oracle.com/technetwork/java/javase/downloads/index.html
When downloading the JDK, make sure it is Version 6 that you
download and not the newer Version 7. The Android SDK is not
guaranteed to work correctly with Version 7.
Once the install package has downloaded, execute it and follow the instructions
to install the Java development tools to your PC.
 
Search WWH ::




Custom Search