Functions | |
GLboolean | cluReadQuaternion (CLUquaternion *dest, FILE *file) |
GLboolean | cluReadPlane (CLUplane *dest, FILE *file) |
GLboolean | cluReadSphere (CLUsphere *dest, FILE *file) |
GLboolean | cluReadCone (CLUcone *dest, FILE *file) |
GLboolean | cluReadRay (CLUray *dest, FILE *file) |
GLboolean | cluReadAlignedBox (CLUalignedbox *dest, FILE *file) |
GLboolean cluRead[Name](const CLU[name]* src, FILE* file)
reads CLU 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 CLU structs may contain variable length arrays. Thus, a size_t return value would have little meaning since the size of the CLU struct instance may be unknown. Therefore, these methods check the size_t values for each read and return a GLboolean 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.