Game Development Reference
In-Depth Information
Directive
Description
order
By default each function listed in the S4E file will be added to the
extension in list order and this order is used internally to locate
the correct function pointer to call. As our extension develops
over time, we may want to add or depreciate functions but
still keep related functions together in the S4E file. By adding
order=x after a function declaration we say that this function
will occupy position x in the function order, with x=1 being
immediately after the last function that does not specify an
order value. If that sounds confusing, don't worry; for our own
projects we will probably never need to make use of this feature
as it is only really an issue if we are making our extension
available for other people to use!
There are also a number of global directives that can be specified in the S4E file and
these should be listed at the very start of the file before the include: line. Again our
example makes no use of these directives, but for your information they are listed in
the following table:
Directive
Description
no_init_term
Specifies that the extension needs no initialization or termination
functions to be automatically generated. It is unlikely you
will ever use this directive since these functions are generally
required in order to set up the interface between the extension
and our project code.
errors
Allows access to some macros that make communication of
errors easier to implement by automatically generating functions,
such as GetError , present in many of the S3E APIs that make
up the low-level Marmalade API.
globals
Declares that the extension will require a global structure block
allocated for its internal use and makes some macros available in
order to support getting and setting values in this structure.
callbacks
States that this extension wants to make use of callbacks and will
automatically define callback IDs to support this using the same
approach used in other built-in S3E APIs.
Making an extension for Windows
We'll begin by creating our extension for use on Windows. Obviously it's unlikely
that a Windows PC would feature gyroscope hardware (though I guess not
impossible!), but starting with the Windows version is easiest as it does not require
us to install any additional software or SDKs in order to build it.
Search WWH ::




Custom Search