00001 #include <cl.h>
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030 unsigned int clModelAddMesh(CLmodel* model, CLmesh* mesh)
00031 {
00032 GLuint i;
00033
00034 if (!(model && mesh))
00035 return -1;
00036
00037 for (i = 0; i < model->num_meshes; i++)
00038 if (model->meshes[i] == mesh)
00039 return i;
00040
00041 model->num_meshes++;
00042 model->meshes = (CLmesh**)realloc(model->meshes,
00043 model->num_meshes
00044 * sizeof(CLmesh*));
00045 model->meshes[model->num_meshes - 1] = mesh;
00046
00047 return model->num_meshes - 1;
00048 }
00049
00050
00051
00052
00053
00054
00055