cluwrite.c

00001 #include <clu.h>
00002 
00003 /* used for clwrite methods */
00004 #define _CLU_FWRITE(ptr, size, nmemb, stream) \
00005                   do { \
00006                     if ((fwrite((ptr), (size), (nmemb), (stream)) * (size)) \
00007                         < ((nmemb) * (size))) \
00008                       return GL_FALSE; \
00009                   } while(0)
00010 
00011 GLboolean cluWriteQuaternion(const CLUquaternion* src, FILE* file)
00012 {
00013     if (!src)
00014         return GL_FALSE;
00015 
00016     _CLU_FWRITE(src, sizeof(CLUquaternion), 1, file);
00017 
00018     return GL_TRUE;
00019 }
00020 
00021 GLboolean cluWritePlane(const CLUplane* src, FILE* file)
00022 {
00023     if (!src)
00024         return GL_FALSE;
00025 
00026     _CLU_FWRITE(src, sizeof(CLUplane), 1, file);
00027 
00028     return GL_TRUE;
00029 }
00030 
00031 GLboolean cluWriteSphere(const CLUsphere* src, FILE* file)
00032 {
00033     if (!src)
00034         return GL_FALSE;
00035 
00036     _CLU_FWRITE(src, sizeof(CLUsphere), 1, file);
00037 
00038     return GL_TRUE;
00039 }
00040 
00041 GLboolean cluWriteCone(const CLUcone* src, FILE* file)
00042 {
00043     if (!src)
00044         return GL_FALSE;
00045 
00046     _CLU_FWRITE(src, sizeof(CLUcone), 1, file);
00047 
00048     return GL_TRUE;
00049 }
00050 
00051 GLboolean cluWriteRay(const CLUray* src, FILE* file)
00052 {
00053     if (!src)
00054         return GL_FALSE;
00055 
00056     _CLU_FWRITE(src, sizeof(CLUray), 1, file);
00057 
00058     return GL_TRUE;
00059 }
00060 
00061 GLboolean cluWriteAlignedBox(const CLUalignedbox* src, FILE* file)
00062 {
00063     if (!src)
00064         return GL_FALSE;
00065     
00066     _CLU_FWRITE(src, sizeof(CLUalignedbox), 1, file);
00067     
00068     return GL_TRUE;
00069 }

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