cl.h File Reference

This header file contains defines, typedefs, structs, and function headers for CL. More...

#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include <stdbool.h>
#include <limits.h>
#include <string.h>
#include <assert.h>

Go to the source code of this file.

Data Structures

struct  CLcolour
 Defines a colour (r, g, b, a). More...
struct  CLvertex
 Defines 3D point (x, y, z). More...
struct  CLnormal
 Defines a 3D normal (i, j, k). More...
struct  CLtexcoord
 Defines a 2D texture coordinate (s, t). More...
struct  CLmatrix
 Defines a homogeneous 3D transformation matrix (4x4). More...
struct  CLimage
 Defines a 2D raster image. More...
struct  CLlight
 Defines a light. More...
struct  CLmaterial
 Defines a material. More...
struct  CLtexture
 Defines a 2D texture. More...
struct  CLprimitiveset
 Defines a primitive set. More...
struct  CLmesh
 Defines a mesh. More...
struct  CLmodel
 Defines a model. More...
struct  CLcontext
 Defines a set of materials, textures, lights, meshes, and models. More...

Defines

#define CL_VERSION   2.0
#define CL_PI   3.14159265358979323846
#define CL_PI_2   1.57079632679489661923
#define CL_EPSILON   1.0e-5
#define CL_NONE   0
#define CL_LIGHT_DISPLAY_LIST   (1<<0)
#define CL_MATERIAL_DISPLAY_LIST   (1<<1)
#define CL_TEXTURE_OBJECT   (1<<2)
#define CL_COLOUR   (1<<3)
#define CL_MATERIAL   (1<<4)
#define CL_TEXTURE   (1<<5)
#define CL_TEXTURE_ENV_MODE   (1<<6)
#define CL_VERTICES   (1<<7)
#define CL_NORMALS   (1<<8)
#define CL_COLOURS   (1<<9)
#define CL_TEXCOORDS   (1<<10)
#define CL_EDGEFLAGS   (1<<11)
#define CL_MESH_DISPLAY_LIST   (1<<12)
#define CL_VERBOSE   (1<<16)
#define CL_ALL   -1
#define CL_DEG2RAD(f)   (((f) * CL_PI_2) / 90.0f)
#define CL_RAD2DEG(f)   (((f) * 90.0f) / (CL_PI_2))
#define CL_CROP(f, lb, ub)   ((f) < (lb) ? (lb) : (f) > (ub) ? (ub) : (f))
#define CL_MIN(a, b)   ((a) > (b) ? (b) : (a))
#define CL_MAX(a, b)   ((a) < (b) ? (b) : (a))
#define CL_BOOLEAN(a)   ((bool)((a) ? GL_TRUE : GL_FALSE))
#define CL_PRINTF()   if (printf(__VA_ARGS__) < 0) return GL_FALSE
#define CL_ERROR()   fprintf(stderr, "%s:%u:%s() : ERROR : ", __FILE__, __LINE__, __FUNCTION__); fprintf(stderr, __VA_ARGS__)
#define CL_FUNCENTRY()   if (clIsEnabled(CL_VERBOSE)) printf ("%s() : ENTRY\n", __FUNCTION__)
#define CL_FUNCEXIT()   if (clIsEnabled(CL_VERBOSE)) printf ("%s() : EXIT\n", __FUNCTION__)
#define CL_MALLOC(n)   ((n) ? malloc(n) : 0)
#define CL_MEMCPY(dest, src, size)   (((dest) && (src) && (size)) ? memcpy((dest), (src), (size)) : 0)

Typedefs

typedef GLenum CLenum
typedef CLcolour CLcolour
typedef CLvertex CLvertex
typedef CLnormal CLnormal
typedef CLtexcoord CLtexcoord
typedef bool CLedgeflag
typedef CLmatrix CLmatrix
typedef CLimage CLimage
typedef CLlight CLlight
typedef CLmaterial CLmaterial
typedef CLtexture CLtexture
typedef CLprimitiveset CLprimitiveset
typedef CLmesh CLmesh
typedef CLmodel CLmodel
typedef CLcontext CLcontext

Functions

CLimageclInitImage (CLimage *image)
CLmaterialclInitMaterial (CLmaterial *material)
CLlightclInitLight (CLlight *light)
CLtextureclInitTexture (CLtexture *texture)
CLprimitivesetclInitPrimitiveSet (CLprimitiveset *primitiveset)
CLmeshclInitMesh (CLmesh *mesh)
CLcontextclInitContext (CLcontext *context)
CLmodelclInitModel (CLmodel *model)
CLimageclClearImage (CLimage *image)
CLlightclClearLight (CLlight *light)
CLmaterialclClearMaterial (CLmaterial *material)
CLtextureclClearTexture (CLtexture *texture)
CLprimitivesetclClearPrimitiveSet (CLprimitiveset *primitiveset)
CLmeshclClearMesh (CLmesh *mesh)
CLcontextclClearContext (CLcontext *context)
CLmodelclClearModel (CLmodel *model)
CLcolourclNewColour (GLvoid)
CLvertexclNewVertex (GLvoid)
CLnormalclNewNormal (GLvoid)
CLtexcoordclNewTexCoord (GLvoid)
CLedgeflagclNewEdgeFlag (GLvoid)
CLmatrixclNewMatrix (GLvoid)
CLimageclNewImage (GLvoid)
CLlightclNewLight (GLvoid)
CLmaterialclNewMaterial (GLvoid)
CLtextureclNewTexture (GLvoid)
CLprimitivesetclNewPrimitiveSet (GLvoid)
CLmeshclNewMesh (GLvoid)
CLcontextclNewContext (GLvoid)
CLmodelclNewModel (GLvoid)
void clDeleteColour (CLcolour *colour)
void clDeleteVertex (CLvertex *vertex)
void clDeleteNormal (CLnormal *normal)
void clDeleteTexCoord (CLtexcoord *texcoord)
void clDeleteEdgeFlag (CLedgeflag *edgeflag)
void clDeleteMatrix (CLmatrix *matrix)
void clDeleteImage (CLimage *image)
void clDeleteLight (CLlight *light)
void clDeleteMaterial (CLmaterial *material)
void clDeleteTexture (CLtexture *texture)
void clDeletePrimitiveSet (CLprimitiveset *primitiveset)
void clDeleteMesh (CLmesh *mesh)
void clDeleteContext (CLcontext *context)
void clDeleteModel (CLmodel *model)
CLcolourclCopyColour (CLcolour *dest, const CLcolour *src)
CLvertexclCopyVertex (CLvertex *dest, const CLvertex *src)
CLnormalclCopyNormal (CLnormal *dest, const CLnormal *src)
CLtexcoordclCopyTexCoord (CLtexcoord *dest, const CLtexcoord *src)
CLedgeflagclCopyEdgeFlag (CLedgeflag *dest, const CLedgeflag *src)
CLmatrixclCopyMatrix (CLmatrix *dest, const CLmatrix *src)
CLimageclCopyImage (CLimage *dest, const CLimage *src)
CLlightclCopyLight (CLlight *dest, const CLlight *src)
CLmaterialclCopyMaterial (CLmaterial *dest, const CLmaterial *src)
CLtextureclCopyTexture (CLtexture *dest, const CLtexture *src)
CLprimitivesetclCopyPrimitiveSet (CLprimitiveset *dest, const CLprimitiveset *src)
CLmeshclCopyMesh (CLmesh *dest, const CLmesh *src)
CLcontextclCopyContext (CLcontext *dest, const CLcontext *src)
CLmodelclCopyModel (CLmodel *dest, const CLmodel *src)
CLcolourclDefaultColour (CLcolour *colour)
CLvertexclDefaultVertex (CLvertex *vertex)
CLnormalclDefaultNormal (CLnormal *normal)
CLtexcoordclDefaultTexCoord (CLtexcoord *texcoord)
CLedgeflagclDefaultEdgeFlag (CLedgeflag *edgeflag)
CLmatrixclDefaultMatrix (CLmatrix *matrix)
CLimageclDefaultImage (CLimage *image)
CLlightclDefaultLight (CLlight *light)
CLmaterialclDefaultMaterial (CLmaterial *material)
CLtextureclDefaultTexture (CLtexture *texture)
CLprimitivesetclDefaultPrimitiveSet (CLprimitiveset *primitiveset)
CLmeshclDefaultMesh (CLmesh *mesh)
CLcontextclDefaultContext (CLcontext *context)
CLmodelclDefaultModel (CLmodel *model)
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)
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 clPrintEnum (const CLenum *e)
bool clPrintColour (const CLcolour *colour)
bool clPrintVertex (const CLvertex *vertex)
bool clPrintNormal (const CLnormal *normal)
bool clPrintTexCoord (const CLtexcoord *texcoord)
bool clPrintEdgeFlag (const CLedgeflag *edgeflag)
bool clPrintMatrix (const CLmatrix *matrix)
bool clPrintImage (const CLimage *image)
bool clPrintLight (const CLlight *light)
bool clPrintMaterial (const CLmaterial *material)
bool clPrintTexture (const CLtexture *texture)
bool clPrintPrimitiveSet (const CLprimitiveset *primitiveset)
bool clPrintMesh (const CLmesh *mesh)
bool clPrintContext (const CLcontext *context)
bool clPrintModel (const CLmodel *model)
bool clPrintContextSummary (const CLcontext *context)
bool clPrintModelSummary (const CLmodel *model)
 A brief summary of the contents of the CLmodel.
void clEnable (CLenum e)
void clDisable (CLenum e)
bool clIsEnabled (CLenum e)
void clUpdateLight (CLlight *light)
void clUpdateMaterial (CLmaterial *material)
void clUpdateTexture (CLtexture *texture)
void clUpdateMesh (CLmesh *mesh)
void clUpdateContext (CLcontext *context)
void clLoadLight (const CLlight *light)
void clLoadMaterial (const CLmaterial *material)
void clLoadTexture (const CLtexture *texture)
void clDrawImage (const CLimage *image)
void clRenderMesh (const CLmesh *mesh)
void clRenderMeshVisible (const CLmesh *mesh, const bool **flags)
void clRenderModel (const CLmodel *model)
GLuint clImageNumPixels (const CLimage *image)
GLuint clImagePixelSize (const CLimage *image)
GLuint clImageNumElements (const CLimage *image)
GLuint clImageElementSize (const CLimage *image)
GLuint clImageDataSize (const CLimage *image)
unsigned int clMeshAddPrimitiveSet (CLmesh *mesh, CLprimitiveset *primitiveset)
unsigned int clModelAddMesh (CLmodel *model, CLmesh *mesh)
unsigned int clContextAddMaterial (CLcontext *context, CLmaterial *material)
unsigned int clContextAddTexture (CLcontext *context, CLtexture *texture)
unsigned int clContextAddLight (CLcontext *context, CLlight *light)
unsigned int clContextAddModel (CLcontext *context, CLmodel *model)


Detailed Description

This header file contains defines, typedes, structs, and function headers for CL.

Definition in file cl.h.


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