Game Development Reference
In-Depth Information
Resource Management and
2D Graphics Rendering
Unless you happen to be writing an old school text adventure game (and perhaps
even if you are), chances are that you will want more than just text in a simple debug
font to appear on screen. Drawing nice-looking graphics demands that we should
also be able to load those graphics into memory in order to display them; so in this
chapter we will be looking at the following:
• Using Marmalade's resource manager to load games resources
• Extending the resource management system with our own custom classes
• The programming choices we have available to us for rendering purposes
• How to display a bitmapped image on screen using the IwGx API
The Marmalade ITX file format
An ITX file is Marmalade's built-in file format that can be used for loading all kinds
of data into our program. The extension ITX is short for Ideaworks TeXt; Ideaworks
being the original name of the company that created the SDK before they rebranded
themselves as Marmalade.
ITX files have a simple text format and are used as the basis for resource loading.
While it is possible to load resources ourselves, it is a bit like reinventing the wheel
when Marmalade already provides a great deal of support for this truly tedious
aspect of coding.
Marmalade has an API called IwUtil that contains a wide range of useful utility
functions ranging from memory management and debugging through to the
serialization of objects and random number generation. It also contains a class
called CIwTextParserITX , which allows us to load and process an ITX file.
Search WWH ::




Custom Search