Functions | |
bool | clReadColour (CLcolour *dest, FILE *file) |
bool | clReadVertex (CLvertex *dest, FILE *file) |
bool | clReadNormal (CLnormal *dest, FILE *file) |
bool | clReadTexCoord (CLtexcoord *dest, FILE *file) |
bool | clReadEdgeFlag (CLedgeflag *dest, FILE *file) |
bool | clReadMatrix (CLmatrix *dest, FILE *file) |
bool | clReadImage (CLimage *dest, FILE *file) |
bool | clReadLight (CLlight *dest, FILE *file) |
bool | clReadMaterial (CLmaterial *dest, FILE *file) |
bool | clReadTexture (CLtexture *dest, FILE *file) |
bool | clReadPrimitiveSet (CLprimitiveset *dest, FILE *file) |
bool | clReadMesh (CLmesh *dest, FILE *file) |
bool | clReadContext (CLcontext *dest, FILE *file) |
bool | clReadModel (CLmodel *dest, FILE *file) |
bool clRead[Name](const CL[name]* src, FILE* file)
reads CL structs from files. These functions are similar to the standard "fread" function. However, there are a few important differences. The fread function returns a size_t indicating the number of elements read. This makes sense for fixed size structs, but many CL structs may contain variable length arrays. Thus, a size_t return value would have little meaning since the size of the CL struct instance may be unknown. Therefore, these methods check the size_t values for each read and return a bool at the end; a GL_TRUE if all attempts where successful, or a GL_FALSE otherwise. The user then can use the "feof" and "ferror" functions to determine the problem. NULL pointers cannot be read; GL_FALSE is returned.