Callisto function reference  5.2
Global functions

Functions

int CAL_AddLogEntry (char *entry)
 
int CAL_AddTextureResource (char *pathName)
 
int CAL_End ()
 
int CAL_Initialisation (bool visualisation=true, char *logFile=CAL_NULL, char *visLogFile=CAL_NULL)
 
int CAL_LoadScene (char *fileName, int parentID, bool eraseCurrent, char *&error)
 
int CAL_LoadTexture (int textureID, char *fileName)
 
int CAL_SaveScene (char *fileName, int groupID)
 
int CAL_SetKeypressCallback (CAL_KeypressCallback cb)
 
int CAL_SetObjectSelectCallback (CAL_ObjectSelectCallback cb)
 
int CAL_SetTextureFromMem (int textureID, int width, int height, unsigned char *tex)
 

Detailed Description

Function Documentation

int CAL_AddLogEntry ( char *  entry)

Add an entry to the Callisto log file.

Parameters
entryThe text of the entry.
int CAL_AddTextureResource ( char *  pathName)

Adds a resource (i.e. a directory) to the list of available resources.

Parameters
pathNameThe name of the path to add to the list of resources.
int CAL_End ( )

This function ends Callisto and cleans up memory.

Returns
The function returns CAL_SUCCESS on success, and an errorcode on failure.
int CAL_Initialisation ( bool  visualisation = true,
char *  logFile = CAL_NULL,
char *  visLogFile = CAL_NULL 
)

This function initializes Callisto, starts the output window and GUI.

Parameters
visualisationSet to false if you dont want a visualisation window, default is TRUE.
logFileProvide a filename to create a Callisto logging file (WARNING: this may become large!). Provide CAL_NULL for no logging.
visLogFileProvide a filename for the visualisation library log file. Provide CAL_NULL for no logging.
Returns
The function returns CAL_SUCCESS on success, and an errorcode on failure.
int CAL_LoadScene ( char *  fileName,
int  parentID,
bool  eraseCurrent,
char *&  error 
)

Load a scene in XML or VRML format from disk.

Parameters
*fileNameThe name of the file to load.
parentIDThe parent group to put the loaded scene in, use 0 for no parent.
eraseCurrentErase the current scene (objects and groups).
**errorString with possible error string. Can be omitted.
Returns
The function returns CAL_SUCCESS on success, and an errorcode on failure.
int CAL_LoadTexture ( int  textureID,
char *  fileName 
)

Loads a texture to memory. The texture must be in the .ppm or the .png format. Do not forget to add a texture resource path first by using CAL_AddTextureResource.

Parameters
textureIDThe ID you want to give the texture, there is room for 500 textures numbered (0..499).
fileNameThe filename of the texture. Do not add the filepath (this should be added through CAL_AddTextureResource). The texture has to be in .ppm, .png or .jpg format.
Returns
The function returns CAL_SUCCESS on success, and an errorcode on failure.
int CAL_SaveScene ( char *  fileName,
int  groupID 
)

Save a (part of a) scene in XML or VRML format from disk.

Parameters
*fileNameThe name of the file to load.
groupIDThe group id of the group that needs to be saved
Returns
The function returns CAL_SUCCESS on success, and an errorcode on failure.
int CAL_SetKeypressCallback ( CAL_KeypressCallback  cb)

Set a callback function, this is called when the user pressed a key in a view.

Parameters
cbThe adress of the callback function.
Returns
The function returns CAL_SUCCESS on success, and an errorcode on failure.
int CAL_SetObjectSelectCallback ( CAL_ObjectSelectCallback  cb)

Set a callback function, this is called when the user selects an object by clicking the left mouse button while pressing SHIFT.

Parameters
cbThe adress of the callback function.
Returns
The function returns CAL_SUCCESS on success, and an errorcode on failure.
int CAL_SetTextureFromMem ( int  textureID,
int  width,
int  height,
unsigned char *  tex 
)

Add a texture from memory.

Parameters
textureIDThe ID you want to give the texture.
widthThe width in pixels of the texture. Must be a power of 2.
heightThe height in pixels of the texture. Must be a power of 2.
texThe textures in RGB format. The format is 8 bits red, 8 bits green and 8 bits blue (3 bytes per pixel). Length is width*height*3.
Returns
The function returns CAL_SUCCESS on success, and an errorcode on failure.