Callisto function reference
5.2
|
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) |
int CAL_AddLogEntry | ( | char * | entry | ) |
Add an entry to the Callisto log file.
entry | The text of the entry. |
int CAL_AddTextureResource | ( | char * | pathName | ) |
Adds a resource (i.e. a directory) to the list of available resources.
pathName | The name of the path to add to the list of resources. |
int CAL_End | ( | ) |
This function ends Callisto and cleans up memory.
int CAL_Initialisation | ( | bool | visualisation = true , |
char * | logFile = CAL_NULL , |
||
char * | visLogFile = CAL_NULL |
||
) |
This function initializes Callisto, starts the output window and GUI.
visualisation | Set to false if you dont want a visualisation window, default is TRUE. |
logFile | Provide a filename to create a Callisto logging file (WARNING: this may become large!). Provide CAL_NULL for no logging. |
visLogFile | Provide a filename for the visualisation library log file. Provide CAL_NULL for no logging. |
int CAL_LoadScene | ( | char * | fileName, |
int | parentID, | ||
bool | eraseCurrent, | ||
char *& | error | ||
) |
Load a scene in XML or VRML format from disk.
*fileName | The name of the file to load. |
parentID | The parent group to put the loaded scene in, use 0 for no parent. |
eraseCurrent | Erase the current scene (objects and groups). |
**error | String with possible error string. Can be omitted. |
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.
textureID | The ID you want to give the texture, there is room for 500 textures numbered (0..499). |
fileName | The 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. |
int CAL_SaveScene | ( | char * | fileName, |
int | groupID | ||
) |
Save a (part of a) scene in XML or VRML format from disk.
*fileName | The name of the file to load. |
groupID | The group id of the group that needs to be saved |
int CAL_SetKeypressCallback | ( | CAL_KeypressCallback | cb | ) |
Set a callback function, this is called when the user pressed a key in a view.
cb | The adress of the callback function. |
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.
cb | The adress of the callback function. |
int CAL_SetTextureFromMem | ( | int | textureID, |
int | width, | ||
int | height, | ||
unsigned char * | tex | ||
) |
Add a texture from memory.
textureID | The ID you want to give the texture. |
width | The width in pixels of the texture. Must be a power of 2. |
height | The height in pixels of the texture. Must be a power of 2. |
tex | The 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. |