overview wiki api reference download
 All Classes Functions Variables Typedefs Enumerations Enumerator
Classes | Public Member Functions | Static Public Member Functions
gameplay::Bundle Class Reference

#include <Bundle.h>

Inheritance diagram for gameplay::Bundle:
gameplay::Ref

List of all members.

Classes

struct  MeshData
struct  MeshPartData
struct  MeshSkinData
class  Reference

Public Member Functions

SceneloadScene (const char *id=NULL)
NodeloadNode (const char *id)
MeshloadMesh (const char *id)
FontloadFont (const char *id)
bool contains (const char *id) const
unsigned int getObjectCount () const
const char * getObjectId (unsigned int index) const
unsigned int getVersionMajor () const
unsigned int getVersionMinor () const

Static Public Member Functions

static Bundlecreate (const char *path)

Detailed Description

Defines a gameplay bundle file (.gpb) that contains a collection of binary game assets that can be loaded.


Member Function Documentation

bool gameplay::Bundle::contains ( const char *  id) const

Determines if this bundle contains a top-level object with the given ID.

This method performs a case-sensitive comparison.

Parameters:
idThe ID of the object to search for.
static Bundle* gameplay::Bundle::create ( const char *  path) [static]

Returns a Bundle for the given resource path.

The specified path must reference a valid gameplay bundle file. If the bundle is already loaded, the existing bundle is returned with its reference count incremented. When no longer needed, the release() method must be called. Note that calling release() does NOT free any actual game objects created/returned from the Bundle instance and those objects must be released separately.

Returns:
The new Bundle or NULL if there was an error.
unsigned int gameplay::Bundle::getObjectCount ( ) const

Returns the number of top-level objects in this bundle.

const char* gameplay::Bundle::getObjectId ( unsigned int  index) const

Gets the unique identifier of the top-level object at the specified index in this bundle.

Parameters:
indexThe index of the object.
Returns:
The ID of the object at the given index, or NULL if index is invalid.
unsigned int gameplay::Bundle::getVersionMajor ( ) const

Gets the major version of the loaded bundle.

Returns:
The major version of the loaded bundle.
unsigned int gameplay::Bundle::getVersionMinor ( ) const

Gets the minor version of the loaded bundle.

Returns:
The minor version of the loaded bundle.
Font* gameplay::Bundle::loadFont ( const char *  id)

Loads a font with the specified ID from the bundle.

Parameters:
idThe ID of the font to load.
Returns:
The loaded font, or NULL if the font could not be loaded.
Mesh* gameplay::Bundle::loadMesh ( const char *  id)

Loads a mesh with the specified ID from the bundle.

Parameters:
idThe ID of the mesh to load.
Returns:
The loaded mesh, or NULL if the mesh could not be loaded.
Node* gameplay::Bundle::loadNode ( const char *  id)

Loads a node with the specified ID from the bundle.

Parameters:
idThe ID of the node to load in the bundle.
Returns:
The loaded node, or NULL if the node could not be loaded.
Scene* gameplay::Bundle::loadScene ( const char *  id = NULL)

Loads the scene with the specified ID from the bundle. If id is NULL then the first scene found is loaded.

Parameters:
idThe ID of the scene to load (NULL to load the first scene).
Returns:
The loaded scene, or NULL if the scene could not be loaded.
 All Classes Functions Variables Typedefs Enumerations Enumerator