| PathEngine home | previous: | next: |
To avoid the need for platform specific code inside PathEngine
data is loaded into memory buffers.
The testbed provides a function that does the platform specific job
of loading that buffer from disk.
iMesh* mesh;
{
char* buffer;
tUnsigned32 size;
buffer = testbed->loadBinary("..\\resource\\meshes\\mesh1.xml", size);
mesh = pathengine->loadMeshFromBuffer("xml", buffer, size, 0);
testbed->freeBuffer(buffer);
}
|
tUnsigned32 is a typedef supplied by PathEngine's API headers to enable 32
bit unsigned integers to be specified in a compiler independant manner.
Refer to this page for more information about PathEngine's integer typedefs.
'size' is set to the size of the buffer created.
We then pass the resulting buffer and size into
The first argument to loadMeshFromBuffer() specifies how PathEngine should interpret
the buffer.
See
The last argument to loadMeshFromBuffer() enables a set of arbitrary attributes to be passed in to control
aspects of the mesh loading process.
(Refer to
In this case we simply pass a null pointer to indicate no attributes, since we just want the default mesh loading behaviour.
The following code sets the testbed current mesh to the mesh we have just loaded.
testbed->setMesh(mesh); testbed->zoomExtents(); |
| Documentation for PathEngine release 5.17 - Copyright © 2002-2008 PathEngine | next: |