clWrite functions
[Standard functions]

Standard functions to write CL structs to a file in binary. More...

Functions

bool clWriteColour (const CLcolour *src, FILE *file)
bool clWriteVertex (const CLvertex *src, FILE *file)
bool clWriteNormal (const CLnormal *src, FILE *file)
bool clWriteTexCoord (const CLtexcoord *src, FILE *file)
bool clWriteEdgeFlag (const CLedgeflag *src, FILE *file)
bool clWriteMatrix (const CLmatrix *src, FILE *file)
bool clWriteImage (const CLimage *src, FILE *file)
bool clWriteLight (const CLlight *src, FILE *file)
bool clWriteMaterial (const CLmaterial *src, FILE *file)
bool clWriteTexture (const CLtexture *src, FILE *file)
bool clWritePrimitiveSet (const CLprimitiveset *src, FILE *file)
bool clWriteMesh (const CLmesh *src, FILE *file)
bool clWriteContext (const CLcontext *src, FILE *file)
bool clWriteModel (const CLmodel *src, FILE *file)

Detailed Description

Functions of the form:

  bool clWrite[Name](const CL[name]* src, FILE* file)
  

write CL structs to files. These functions are similar to the standard "fwrite" function. However, there are a few important differences. The fwrite function returns a size_t indicating the number of elements written. 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 write 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 written; GL_FALSE is returned.


Function Documentation

bool clWriteColour const CLcolour src,
FILE *  file
 

Todo:
Should arguments be swapped to fit "dest then src" standard

Definition at line 15 of file clwrite.c.

Referenced by clWriteMesh().

bool clWriteModel const CLmodel src,
FILE *  file
 

Todo:
Function Incorrect

Definition at line 197 of file clwrite.c.

References clWriteMesh(), CLmodel::meshes, and CLmodel::num_meshes.

Referenced by clWriteContext().


Generated on Thu Dec 27 13:53:42 2007 for CL by  doxygen 1.4.6