Game Development Reference
In-Depth Information
Defining image templates
We can also use the resource template system to specify how we want images
to be processed, which includes the ability to specify what texture format is
used. To define a resource template for images we have to declare an instance of
CIwResTemplateImage , which can be configured using the following parameters:
Parameter
Description
formatSW and
formatHW
Converts any image to the requested format. The
two versions of this parameter allow a format to
be defined for the software renderer and another
format for OpenGL ES rendering.
For a complete list of texture formats, take a look at
the Marmalade documentation for the CIwImage
class, but bear in mind that some of these formats
apply only to software or hardware rendering. For
example, OpenGL ES does not support any of the
palette-based formats, while the software renderer
does not support compressed formats such as
PVRTC or ATITC.
compressForDiskSpace
When true , converting textures using the
formatSW and formatHW parameters will only
store the converted version in the binary version of
the GROUP file if it is smaller (in memory terms)
than the image in its original format. Defaults to
false .
mipMapping
When true , mipmaps will automatically be
generated for the image. It can be very useful to set
this to false for images that will form part of the
UI, since these generally want to be drawn at their
native size and mipmaps will not be needed.
allowLowQualityCompression
If using a hardware compressed format,
Marmalade will not use the requested compression
if the resulting texture is likely to be of low quality,
for example, when using PVRTC on an image with
an alpha channel. Setting this parameter to true
allows you to force Marmalade to perform the
requested compression.
ignoreImages
If set to true , images will be ignored and a 2 x 2
checkerboard texture will be used instead. Can be
useful when debugging to speed up loading time.
Search WWH ::




Custom Search